From 09218a4cb5b8d13d337b202a9681ccda0cb5b9b2 Mon Sep 17 00:00:00 2001 From: thurendous Date: Thu, 19 Sep 2024 14:59:37 +0900 Subject: [PATCH] fix code after changing to 49 --- foundry.toml | 2 +- test/fuzz/FuzzVotingPowerExchange.t.sol | 4 ++++ test/integration/VotingPowerExchange.t.sol | 6 +++++- test/unit/VotingPowerExchange.t.sol | 4 ++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/foundry.toml b/foundry.toml index e216b21..91a3e47 100644 --- a/foundry.toml +++ b/foundry.toml @@ -11,6 +11,6 @@ solc = "0.8.24" remappings = ["forge-std/=lib/forge-std/src/"] [fuzz] -runs = 4096 +runs = 3072 # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options diff --git a/test/fuzz/FuzzVotingPowerExchange.t.sol b/test/fuzz/FuzzVotingPowerExchange.t.sol index 0979201..cfa8546 100644 --- a/test/fuzz/FuzzVotingPowerExchange.t.sol +++ b/test/fuzz/FuzzVotingPowerExchange.t.sol @@ -66,6 +66,10 @@ contract VotingPwoerExchangeTest is Test { utilityToken.mint(participant2, 10_000 * 1e18); vm.stopPrank(); + // set the voting power cap to 99e18 + vm.prank(manager); + votingPowerExchange.setVotingPowerCap(99e18); + // set up the roles for exchange contract helper = new VotingPowerExchangeTestHelper(); diff --git a/test/integration/VotingPowerExchange.t.sol b/test/integration/VotingPowerExchange.t.sol index 98141af..b378595 100644 --- a/test/integration/VotingPowerExchange.t.sol +++ b/test/integration/VotingPowerExchange.t.sol @@ -68,6 +68,10 @@ contract VotingPowerExchangeTest is Test { helper = new VotingPowerExchangeTestHelper(); + // set the voting power cap to 99e18 + vm.prank(manager); + votingPowerExchange.setVotingPowerCap(99e18); + // other setup vm.label(participant, "participant"); vm.label(participant2, "participant2"); @@ -208,7 +212,7 @@ contract VotingPowerExchangeTest is Test { VotingPowerExchange vpe = new VotingPowerExchange(address(utilityToken), address(govToken), admin, manager, exchanger); assertTrue(address(vpe) != address(0)); - assertEq(vpe.getVotingPowerCap(), 99 * 1e18); + assertEq(vpe.getVotingPowerCap(), 49 * 1e18); } function testBasicVotingPowerExchangeInfo() public view { diff --git a/test/unit/VotingPowerExchange.t.sol b/test/unit/VotingPowerExchange.t.sol index ae87ddc..71ee1f0 100644 --- a/test/unit/VotingPowerExchange.t.sol +++ b/test/unit/VotingPowerExchange.t.sol @@ -7,11 +7,15 @@ import {Strings} from "@openzeppelin/contracts/utils/Strings.sol"; contract VotingPowerExchangeUnitTest is Test { VotingPowerExchange public votingPowerExchange; + address public manager = makeAddr("manager"); function setUp() public { // We need to deploy VotingPowerExchange votingPowerExchange = new VotingPowerExchange(address(this), address(this), address(this), address(this), address(this)); + // set the cap to 99e18 + vm.prank(address(this)); + votingPowerExchange.setVotingPowerCap(99e18); } function testConstructorValidation() public {