@@ -25,6 +25,7 @@ contract MockPausable is IPausable {
25
25
contract PauseControllerTest is Test {
26
26
event Pause (address indexed component );
27
27
event Unpause (address indexed component );
28
+ event ResetPauseCooldownPeriod (address indexed component );
28
29
event UpdatePauseCooldownPeriod (uint256 oldPauseCooldownPeriod , uint256 newPauseCooldownPeriod );
29
30
30
31
uint256 public constant PAUSE_COOLDOWN_PERIOD = 1 days ;
@@ -117,8 +118,22 @@ contract PauseControllerTest is Test {
117
118
emit Unpause (address (mockPausable));
118
119
pauseController.unpause (mockPausable);
119
120
assertEq (pauseController.getLastUnpauseTime (mockPausable), block .timestamp );
121
+ assertFalse (mockPausable.paused ());
120
122
123
+ // cannot pause before cooldown period
124
+ vm.expectRevert (PauseController.ErrorCooldownPeriodNotPassed.selector );
125
+ pauseController.pause (mockPausable);
126
+
127
+ // reset pause cooldown period
128
+ vm.expectEmit (true , false , false , true );
129
+ emit ResetPauseCooldownPeriod (address (mockPausable));
130
+ pauseController.resetPauseCooldownPeriod (mockPausable);
131
+ assertEq (pauseController.getLastUnpauseTime (mockPausable), 0 );
132
+
133
+ // can pause after reset
121
134
assertFalse (mockPausable.paused ());
135
+ pauseController.pause (mockPausable);
136
+ assertTrue (mockPausable.paused ());
122
137
123
138
vm.stopPrank ();
124
139
}
0 commit comments