From e27684591c82a94807c03a2db87cac7aefd4a805 Mon Sep 17 00:00:00 2001 From: Bogdan Kovtun Date: Mon, 30 Sep 2024 13:47:28 +0400 Subject: [PATCH] Fix wrong EmergencyProtectedTimelock constructor param set --- contracts/EmergencyProtectedTimelock.sol | 2 +- test/unit/EmergencyProtectedTimelock.t.sol | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/contracts/EmergencyProtectedTimelock.sol b/contracts/EmergencyProtectedTimelock.sol index 12237025..645eba5d 100644 --- a/contracts/EmergencyProtectedTimelock.sol +++ b/contracts/EmergencyProtectedTimelock.sol @@ -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; } // --- diff --git a/test/unit/EmergencyProtectedTimelock.t.sol b/test/unit/EmergencyProtectedTimelock.t.sol index 4feeb489..d5827462 100644 --- a/test/unit/EmergencyProtectedTimelock.t.sol +++ b/test/unit/EmergencyProtectedTimelock.t.sol @@ -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 {