@@ -35,19 +35,16 @@ contract VetoableSlasherTest is Test {
35
35
mockStrategy = IStrategy (address (0x5 ));
36
36
slashingRegistryCoordinator = address (0x6 );
37
37
38
- // Deploy proxy admin
39
38
vm.startPrank (proxyAdminOwner);
40
39
proxyAdmin = new ProxyAdmin ();
41
40
emptyContract = new EmptyContract ();
42
41
43
- // Deploy vetoable slasher behind proxy
44
42
vetoableSlasher = VetoableSlasher (
45
43
address (
46
44
new TransparentUpgradeableProxy (address (emptyContract), address (proxyAdmin), "" )
47
45
)
48
46
);
49
47
50
- // Deploy implementation and upgrade
51
48
vetoableSlasherImplementation = new VetoableSlasher (
52
49
IAllocationManager (allocationManager),
53
50
ISlashingRegistryCoordinator (slashingRegistryCoordinator)
@@ -59,7 +56,6 @@ contract VetoableSlasherTest is Test {
59
56
);
60
57
vm.stopPrank ();
61
58
62
- // Initialize
63
59
vetoableSlasher.initialize (vetoCommittee, slasher);
64
60
}
65
61
@@ -96,7 +92,6 @@ contract VetoableSlasherTest is Test {
96
92
vm.prank (slasher);
97
93
vetoableSlasher.queueSlashingRequest (params);
98
94
99
- // Get the request from storage and verify
100
95
(IAllocationManagerTypes.SlashingParams memory resultParams , uint256 requestTimestamp , ISlasherTypes.SlashingStatus status ) = vetoableSlasher.slashingRequests (0 );
101
96
ISlasherTypes.SlashingRequest memory request = ISlasherTypes.SlashingRequest (params, requestTimestamp, status);
102
97
assertEq (resultParams.operator, operator);
@@ -108,57 +103,47 @@ contract VetoableSlasherTest is Test {
108
103
}
109
104
110
105
function test_cancelSlashingRequest_revert_notVetoCommittee () public {
111
- // First queue a request
112
106
IAllocationManagerTypes.SlashingParams memory params = _createMockSlashingParams ();
113
107
114
108
vm.prank (slasher);
115
109
vetoableSlasher.queueSlashingRequest (params);
116
110
117
- // Try to cancel from non-veto committee
118
111
vm.expectRevert (ISlasherErrors.OnlyVetoCommittee.selector );
119
112
vetoableSlasher.cancelSlashingRequest (0 );
120
113
}
121
114
122
115
function test_cancelSlashingRequest_revert_afterVetoPeriod () public {
123
- // First queue a request
124
116
IAllocationManagerTypes.SlashingParams memory params = _createMockSlashingParams ();
125
117
126
118
vm.prank (slasher);
127
119
vetoableSlasher.queueSlashingRequest (params);
128
120
129
- // Move time past veto period
130
121
vm.warp (block .timestamp + VETO_PERIOD + 1 );
131
122
132
- // Try to cancel
133
123
vm.prank (vetoCommittee);
134
124
vm.expectRevert (ISlasherErrors.VetoPeriodPassed.selector );
135
125
vetoableSlasher.cancelSlashingRequest (0 );
136
126
}
137
127
138
128
function test_cancelSlashingRequest () public {
139
- // First queue a request
140
129
IAllocationManagerTypes.SlashingParams memory params = _createMockSlashingParams ();
141
130
142
131
vm.prank (slasher);
143
132
vetoableSlasher.queueSlashingRequest (params);
144
133
145
- // Cancel within veto period
146
134
vm.prank (vetoCommittee);
147
135
vetoableSlasher.cancelSlashingRequest (0 );
148
136
149
- // Verify request is cancelled
150
137
(IAllocationManagerTypes.SlashingParams memory resultParams , uint256 requestTimestamp , ISlasherTypes.SlashingStatus status ) = vetoableSlasher.slashingRequests (0 );
151
138
assertEq (uint8 (status), uint8 (ISlasherTypes.SlashingStatus.Cancelled));
152
139
}
153
140
154
141
function test_fulfillSlashingRequest_revert_beforeVetoPeriod () public {
155
- // First queue a request
156
142
IAllocationManagerTypes.SlashingParams memory params = _createMockSlashingParams ();
157
143
158
144
vm.prank (slasher);
159
145
vetoableSlasher.queueSlashingRequest (params);
160
146
161
- // Try to fulfill before veto period
162
147
vm.prank (slasher);
163
148
vm.expectRevert (ISlasherErrors.VetoPeriodNotPassed.selector );
164
149
vetoableSlasher.fulfillSlashingRequest (0 );
0 commit comments