Skip to content

Commit

Permalink
Add VetoCooldownTest
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmt committed Jul 8, 2024
1 parent 2946832 commit 9c3062c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/kontrol/VetoCooldown.t.sol
Original file line number Diff line number Diff line change
@@ -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);
}
}
1 change: 1 addition & 0 deletions test/kontrol/scripts/run-kontrol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 9c3062c

Please sign in to comment.