From 9c3062c29bbfcb216a6c9d99389ccd50c3170e6d Mon Sep 17 00:00:00 2001 From: lucasmt Date: Sun, 7 Jul 2024 23:56:27 -0500 Subject: [PATCH] Add VetoCooldownTest --- test/kontrol/VetoCooldown.t.sol | 18 ++++++++++++++++++ test/kontrol/scripts/run-kontrol.sh | 1 + 2 files changed, 19 insertions(+) create mode 100644 test/kontrol/VetoCooldown.t.sol diff --git a/test/kontrol/VetoCooldown.t.sol b/test/kontrol/VetoCooldown.t.sol new file mode 100644 index 00000000..130c4063 --- /dev/null +++ b/test/kontrol/VetoCooldown.t.sol @@ -0,0 +1,18 @@ +pragma solidity 0.8.23; + +import "forge-std/Vm.sol"; +import "kontrol-cheatcodes/KontrolCheats.sol"; + +import "@openzeppelin/contracts/utils/math/Math.sol"; + +import "test/kontrol/DualGovernanceSetUp.sol"; + +contract VetoCooldownTest is DualGovernanceSetUp { + function testVetoCooldownDuration() external { + vm.assume(dualGovernance.currentState() == State.VetoCooldown); + + bool stillInVetoCooldown = (dualGovernance.currentState() == State.VetoCooldown); + bool durationHasElapsed = (block.timestamp - _getEnteredAt(dualGovernance) > config.VETO_COOLDOWN_DURATION()); + assert(stillInVetoCooldown == durationHasElapsed); + } +} diff --git a/test/kontrol/scripts/run-kontrol.sh b/test/kontrol/scripts/run-kontrol.sh index f048d04b..f34c6632 100755 --- a/test/kontrol/scripts/run-kontrol.sh +++ b/test/kontrol/scripts/run-kontrol.sh @@ -101,6 +101,7 @@ test_list=() if [ "$SCRIPT_TESTS" == true ]; then # Here go the list of tests to execute with the `script` option test_list=( + "VetoCooldownTest.testVetoCooldownDuration" "VetoSignallingTest.testTransitionNormalToVetoSignalling" "VetoSignallingTest.testVetoSignallingInvariantsHoldInitially" "EscrowAccountingTest.testRageQuitSupport"