Skip to content

Commit

Permalink
Add additional check inside a unit test for GetPastVotes function
Browse files Browse the repository at this point in the history
  • Loading branch information
matjazv committed Feb 21, 2024
1 parent 68b90b7 commit c09ad01
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/L2/L2VotingPower.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,6 @@ contract L2VotingPowerTest is Test {
// increase block timestamp
vm.warp(blockTimestamp + 20);

// check that votes for bob still returns 50
for (uint256 i = 10; i < 20; i++) {
assertEq(l2VotingPower.getPastVotes(bob, blockTimestamp + i), 50);
}

// decrease voting power of alice for 10
positionBefore = LockingPosition(50, 50, 50);
positionAfter = LockingPosition(40, 40, 40);
Expand All @@ -266,6 +261,11 @@ contract L2VotingPowerTest is Test {
for (uint256 i = 20; i < 30; i++) {
assertEq(l2VotingPower.getPastVotes(bob, blockTimestamp + i), 40);
}

// check that past votes for bob for interval [blockTimestamp, blockTimestamp + 20) still returns 50
for (uint256 i = 0; i < 20; i++) {
assertEq(l2VotingPower.getPastVotes(bob, blockTimestamp + i), 50);
}
}

function test_Clock() public {
Expand Down

0 comments on commit c09ad01

Please sign in to comment.