Skip to content

Commit

Permalink
Add gas consumption test for voting on multiple gauges
Browse files Browse the repository at this point in the history
  • Loading branch information
xavikh committed Feb 25, 2025
1 parent 4a56c66 commit bf13422
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/voting/GaugeVote.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -712,4 +712,18 @@ contract TestGaugeVote is GaugeVotingBase {
assertEq(voter.totalVotingPowerCast(), votingPowerBeforeVoting);
assertEq(voter.gaugeVotes(gauge), votingPowerBeforeVoting);
}

// Test for gas consumption
function testVoteFor20Gauges() public {
for (uint160 i = 1; i <= 20; i++) {
voter.createGauge(address(i), string(abi.encodePacked("metadata", i)));
votes.push(GaugeVote(1, address(i)));
}

vm.startPrank(owner);
{
voter.vote(tokenId, votes);
}
vm.stopPrank();
}
}

0 comments on commit bf13422

Please sign in to comment.