Skip to content

Commit

Permalink
Merge pull request #134 from lidofinance/fix/contructor-params
Browse files Browse the repository at this point in the history
Fix `EmergencyProtectedTimelock` constructor param set
  • Loading branch information
bulbozaur authored Oct 2, 2024
2 parents 8733c91 + e276845 commit a563447
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 a563447

Please sign in to comment.