Skip to content

Commit

Permalink
fix fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
thurendous committed Sep 10, 2024
1 parent a7e544d commit 9d64459
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions test/integration/VotingPowerExchange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ contract VotingPwoerExchangeTest is Test {
)
);
votingPowerExchange.exchange(participant2, 1_100 * 1e18, nonce, expirationTime, signature);
// no state change this time, so the authorization state should be false. Others are the same as before.
// no state change this time, so the authorization state should be false. Others are the same as before.
checkExchangeResult(
participant2, 99 * 1e18, 115_240 * 1e18 - 75_240 * 1e18, 75_240 * 1e18, participant, 0, nonce, false
);
Expand All @@ -587,7 +587,7 @@ contract VotingPwoerExchangeTest is Test {
);
vm.startPrank(exchanger);
vm.expectRevert(VotingPowerExchange.VotingPowerExchange__AmountIsTooSmall.selector);
votingPowerExchange.exchange(participant2, 9e14, nonce, expirationTime, signature);
votingPowerExchange.exchange(participant2, 9e14, nonce, expirationTime, signature);
vm.stopPrank();
}

Expand Down Expand Up @@ -647,7 +647,11 @@ contract VotingPwoerExchangeTest is Test {
);
bytes32 digest = createDigest(participant2, 1_100 * 1e18, nonce, expirationTime);
vm.startPrank(exchanger);
vm.expectRevert(abi.encodeWithSelector(VotingPowerExchange.VotingPowerExchange__InvalidSignature.selector, digest, signature));
vm.expectRevert(
abi.encodeWithSelector(
VotingPowerExchange.VotingPowerExchange__InvalidSignature.selector, digest, signature
)
);
votingPowerExchange.exchange(participant2, 1_100 * 1e18, nonce, expirationTime, signature);
vm.stopPrank();
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/VotingPowerExchange.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ contract VotingPowerExchangeUnitTest is Test {
new VotingPowerExchange(address(this), address(this), address(this), address(this), address(this));
}

function testConstructorValidation() public {
function testConstructorValidation() public {
// write a test to deploy the contract and test the validation in the constructor
vm.expectRevert(VotingPowerExchange.VotingPowerExchange__DefaultAdminCannotBeZero.selector);
new VotingPowerExchange(address(1),address(1), address(0), address(0), address(0));
new VotingPowerExchange(address(1), address(1), address(0), address(0), address(0));
vm.expectRevert(VotingPowerExchange.VotingPowerExchange__GovOrUtilAddressIsZero.selector);
new VotingPowerExchange(address(1), address(0), address(1), address(0), address(0));
vm.expectRevert(VotingPowerExchange.VotingPowerExchange__GovOrUtilAddressIsZero.selector);
Expand Down

0 comments on commit 9d64459

Please sign in to comment.