From 9109d983e098e0db429c29d607d172f472e11bfb Mon Sep 17 00:00:00 2001 From: gallo Date: Tue, 15 Oct 2024 12:27:04 +0200 Subject: [PATCH] feat: remove usage of `lastCountedEpoch` --- test/GovernanceAttacks.t.sol | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/test/GovernanceAttacks.t.sol b/test/GovernanceAttacks.t.sol index 071c22b2..15a2563f 100644 --- a/test/GovernanceAttacks.t.sol +++ b/test/GovernanceAttacks.t.sol @@ -217,15 +217,12 @@ contract GovernanceTest is Test { (Governance.VoteSnapshot memory v, Governance.InitiativeVoteSnapshot memory initData) = governance.snapshotVotesForInitiative(address(maliciousInitiative2)); uint256 currentEpoch = governance.epoch(); - assertEq(initData.lastCountedEpoch, currentEpoch - 1, "Epoch Matches"); - + // Inactive for 4 epochs // Add another proposal vm.warp(block.timestamp + governance.EPOCH_DURATION() * 5); /// @audit needs 5? (v, initData) = governance.snapshotVotesForInitiative(address(maliciousInitiative2)); - assertEq(initData.lastCountedEpoch, currentEpoch - 1, "Epoch Matches"); /// @audit This fails if you have 0 votes, see QA - uint256 unregisterSnapshot = vm.snapshot(); maliciousInitiative2.setRevertBehaviour(MaliciousInitiative.FunctionType.UNREGISTER, MaliciousInitiative.RevertType.THROW);