Skip to content

Commit

Permalink
fix code after changing to 49
Browse files Browse the repository at this point in the history
  • Loading branch information
thurendous committed Sep 19, 2024
1 parent b46de78 commit 09218a4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions test/fuzz/FuzzVotingPowerExchange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion test/integration/VotingPowerExchange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/VotingPowerExchange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 09218a4

Please sign in to comment.