Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Commit

Permalink
Add test for EonVoteRegistered event
Browse files Browse the repository at this point in the history
  • Loading branch information
konradkonrad committed Feb 5, 2024
1 parent 5796147 commit 748cb0b
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/EonKeyPublish.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ contract EonKeyPublishTest is Test {
address public initializer;
address public dao;

event EonVoteRegistered(uint64 eon, bytes key);

function setUp() public {
initializer = address(19);
dao = address(42);
Expand Down Expand Up @@ -62,6 +64,29 @@ contract EonKeyPublishTest is Test {
assertEq(ks.isAllowedToBroadcastEonKey(address(publisher)), true);
}

function testEonVoteRegisteredEvent() public {
uint64 eon = 1;
address[] memory members = new address[](5);
members[0] = address(91);
members[1] = address(92);
members[2] = address(93);
keyperSet.addMembers(members);
keyperSet.setThreshold(2);
keyperSet.setPublisher(address(eonKeyPublish));
keyperSet.setFinalized();
assertEq(keyperSet.getThreshold(), 2);
bytes memory key = bytes("deadbeef");
vm.startPrank(dao);
manager.addKeyperSet(uint64(block.number + 10), address(keyperSet));
vm.stopPrank();
for (uint i = 0; i < keyperSet.getThreshold() - 1; i++) {
vm.prank(members[i]);
vm.expectEmit(address(eonKeyPublish));
emit EonVoteRegistered(eon, key);
eonKeyPublish.publishEonKey(key, uint64(i));
}
}

function testPublishEonKey() public {
uint64 eon = 1;
address[] memory members = new address[](5);
Expand Down

0 comments on commit 748cb0b

Please sign in to comment.