Skip to content

Commit

Permalink
Fix wrong EmergencyProtectedTimelock constructor param set
Browse files Browse the repository at this point in the history
  • Loading branch information
Psirex committed Sep 30, 2024
1 parent 1ffa251 commit e276845
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/EmergencyProtectedTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ contract EmergencyProtectedTimelock is IEmergencyProtectedTimelock {
MAX_AFTER_SUBMIT_DELAY = sanityCheckParams.maxAfterSubmitDelay;
MAX_AFTER_SCHEDULE_DELAY = sanityCheckParams.maxAfterScheduleDelay;
MAX_EMERGENCY_MODE_DURATION = sanityCheckParams.maxEmergencyModeDuration;
MAX_EMERGENCY_PROTECTION_DURATION = sanityCheckParams.maxEmergencyModeDuration;
MAX_EMERGENCY_PROTECTION_DURATION = sanityCheckParams.maxEmergencyProtectionDuration;
}

// ---
Expand Down
16 changes: 16 additions & 0 deletions test/unit/EmergencyProtectedTimelock.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ contract EmergencyProtectedTimelockUnitTests is UnitTest {
vm.stopPrank();
}

// EmergencyProtectedTimelock.constructor()

function testFuzz_constructor_HappyPath(
EmergencyProtectedTimelock.SanityCheckParams memory sanityCheckParams,
address adminExecutor
) external {
EmergencyProtectedTimelock timelock = new EmergencyProtectedTimelock(sanityCheckParams, adminExecutor);

assertEq(timelock.getAdminExecutor(), adminExecutor);

assertEq(timelock.MAX_AFTER_SUBMIT_DELAY(), sanityCheckParams.maxAfterSubmitDelay);
assertEq(timelock.MAX_AFTER_SCHEDULE_DELAY(), sanityCheckParams.maxAfterScheduleDelay);
assertEq(timelock.MAX_EMERGENCY_MODE_DURATION(), sanityCheckParams.maxEmergencyModeDuration);
assertEq(timelock.MAX_EMERGENCY_PROTECTION_DURATION(), sanityCheckParams.maxEmergencyProtectionDuration);
}

// EmergencyProtectedTimelock.submit()

function testFuzz_submit_RevertOn_ByStranger(address stranger) external {
Expand Down

0 comments on commit e276845

Please sign in to comment.