@@ -25,6 +25,7 @@ contract MockPausable is IPausable {
2525contract PauseControllerTest is Test {
2626 event Pause (address indexed component );
2727 event Unpause (address indexed component );
28+ event ResetPauseCooldownPeriod (address indexed component );
2829 event UpdatePauseCooldownPeriod (uint256 oldPauseCooldownPeriod , uint256 newPauseCooldownPeriod );
2930
3031 uint256 public constant PAUSE_COOLDOWN_PERIOD = 1 days ;
@@ -117,8 +118,22 @@ contract PauseControllerTest is Test {
117118 emit Unpause (address (mockPausable));
118119 pauseController.unpause (mockPausable);
119120 assertEq (pauseController.getLastUnpauseTime (mockPausable), block .timestamp );
121+ assertFalse (mockPausable.paused ());
120122
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
121134 assertFalse (mockPausable.paused ());
135+ pauseController.pause (mockPausable);
136+ assertTrue (mockPausable.paused ());
122137
123138 vm.stopPrank ();
124139 }
0 commit comments