@@ -10,7 +10,7 @@ contract KeyperSetManagerTest is Test {
10
10
KeyperSet public members0;
11
11
KeyperSet public members1;
12
12
address public owner;
13
-
13
+
14
14
function setUp () public {
15
15
owner = vm.addr (42 );
16
16
vm.prank (owner);
@@ -26,10 +26,10 @@ contract KeyperSetManagerTest is Test {
26
26
function testGetNumKeyperSets () public {
27
27
assertEq (keyperSetManager.getNumKeyperSets (), 0 );
28
28
vm.prank (owner);
29
- keyperSetManager.addKeyperSet (0 , address (members0));
29
+ keyperSetManager.addKeyperSet (1 , address (members0));
30
30
assertEq (keyperSetManager.getNumKeyperSets (), 1 );
31
31
vm.prank (owner);
32
- keyperSetManager.addKeyperSet (1 , address (members0));
32
+ keyperSetManager.addKeyperSet (2 , address (members0));
33
33
assertEq (keyperSetManager.getNumKeyperSets (), 2 );
34
34
}
35
35
@@ -39,7 +39,7 @@ contract KeyperSetManagerTest is Test {
39
39
abi.encodeWithSelector (
40
40
IAccessControl.AccessControlUnauthorizedAccount.selector ,
41
41
address (1 ),
42
- keyperSetManager.DEFAULT_ADMIN_ROLE
42
+ 0
43
43
)
44
44
);
45
45
keyperSetManager.addKeyperSet (0 , address (members0));
@@ -48,23 +48,43 @@ contract KeyperSetManagerTest is Test {
48
48
function testAddKeyperSetRequiresFinalizedSet () public {
49
49
KeyperSet ks = new KeyperSet ();
50
50
vm.expectRevert (KeyperSetNotFinalized.selector );
51
+ vm.prank (owner);
51
52
keyperSetManager.addKeyperSet (0 , address (ks));
52
53
}
53
54
54
55
function testAddKeyperSetRequiresIncreasingActivationBlock () public {
56
+ vm.prank (owner);
55
57
keyperSetManager.addKeyperSet (1000 , address (members0));
56
58
vm.expectRevert (AlreadyHaveKeyperSet.selector );
59
+ vm.prank (owner);
57
60
keyperSetManager.addKeyperSet (999 , address (members1));
61
+ vm.prank (owner);
58
62
keyperSetManager.addKeyperSet (1000 , address (members1));
59
63
}
60
64
61
- event KeyperSetAdded (uint64 activationSlot , address keyperSetContract );
65
+ event KeyperSetAdded (
66
+ uint64 activationBlock ,
67
+ address keyperSetContract ,
68
+ address [] members ,
69
+ uint64 threshold ,
70
+ uint64 eon
71
+ );
62
72
63
73
function testAddKeyperSetEmits () public {
64
74
vm.expectEmit (address (keyperSetManager));
65
- emit KeyperSetAdded (1000 , address (members0));
75
+ address [] memory members;
76
+ emit KeyperSetAdded (
77
+ 1000 ,
78
+ address (members0),
79
+ members,
80
+ 0 ,
81
+ 0
82
+ );
66
83
vm.prank (owner);
67
- keyperSetManager.addKeyperSet (1000 , address (members0));
84
+ keyperSetManager.addKeyperSet (
85
+ 1000 ,
86
+ address (members0)
87
+ );
68
88
}
69
89
70
90
function testGetKeyperSetIndexByBlockEmpty () public {
@@ -73,7 +93,9 @@ contract KeyperSetManagerTest is Test {
73
93
}
74
94
75
95
function testGetKeyperSetIndexByBlock () public {
96
+ vm.prank (owner);
76
97
keyperSetManager.addKeyperSet (1000 , address (members0));
98
+ vm.prank (owner);
77
99
keyperSetManager.addKeyperSet (1100 , address (members1));
78
100
79
101
vm.expectRevert (NoActiveKeyperSet.selector );
@@ -90,14 +112,18 @@ contract KeyperSetManagerTest is Test {
90
112
}
91
113
92
114
function testGetKeyperSetActivationBlock () public {
115
+ vm.prank (owner);
93
116
keyperSetManager.addKeyperSet (1000 , address (members0));
117
+ vm.prank (owner);
94
118
keyperSetManager.addKeyperSet (1100 , address (members1));
95
119
assertEq (keyperSetManager.getKeyperSetActivationBlock (0 ), 1000 );
96
120
assertEq (keyperSetManager.getKeyperSetActivationBlock (1 ), 1100 );
97
121
}
98
122
99
123
function testGetKeyperSetAddress () public {
124
+ vm.prank (owner);
100
125
keyperSetManager.addKeyperSet (1000 , address (members0));
126
+ vm.prank (owner);
101
127
keyperSetManager.addKeyperSet (1100 , address (members1));
102
128
assertEq (keyperSetManager.getKeyperSetAddress (0 ), address (members0));
103
129
assertEq (keyperSetManager.getKeyperSetAddress (1 ), address (members1));
0 commit comments