fix: remove vm.stopPrank if vm.startPrank not present (#719)
* remove vm.stopPrank if vm.startPrank not present * remove unnecessary vm.stopPrank from governance tests
This commit is contained in:
parent
3c414c12e6
commit
5a47f04ffc
@ -39,7 +39,6 @@ contract WETH9V06Test is Test {
|
||||
function testShouldConvertDepositedETHToWrappedETH() public {
|
||||
vm.prank(user);
|
||||
etherToken.deposit{value: 1e20}();
|
||||
vm.stopPrank();
|
||||
|
||||
assertEq(etherToken.balanceOf(user), 1e20);
|
||||
assertEq(address(etherToken).balance, 1e20);
|
||||
@ -58,7 +57,6 @@ contract WETH9V06Test is Test {
|
||||
etherToken.deposit{value: 1e20}();
|
||||
vm.prank(user);
|
||||
etherToken.withdraw(100);
|
||||
vm.stopPrank();
|
||||
|
||||
assertEq(etherToken.balanceOf(user), 1e20 - 100);
|
||||
assertEq(address(etherToken).balance, 1e20 - 100);
|
||||
@ -68,7 +66,6 @@ contract WETH9V06Test is Test {
|
||||
function testShouldConvertSentETHToWrappedETH() public {
|
||||
vm.prank(user);
|
||||
address(etherToken).call{value: 1e20}(new bytes(0));
|
||||
vm.stopPrank();
|
||||
|
||||
assertEq(etherToken.balanceOf(user), 1e20);
|
||||
assertEq(address(etherToken).balance, 1e20);
|
||||
|
@ -34,7 +34,6 @@ contract ZRXTokenTest is Test {
|
||||
assembly {
|
||||
_address := create(0, add(_bytecode, 0x20), mload(_bytecode))
|
||||
}
|
||||
vm.stopPrank();
|
||||
zrxToken = IERC20Token(address(_address));
|
||||
}
|
||||
|
||||
@ -73,7 +72,6 @@ contract ZRXTokenTest is Test {
|
||||
function testShouldReturnFalseIfSenderHasInsufficientBalance() public {
|
||||
vm.prank(owner);
|
||||
zrxToken.approve(user, totalSupply + 1);
|
||||
vm.stopPrank();
|
||||
|
||||
bool success = zrxToken.transferFrom(owner, user, totalSupply + 1);
|
||||
assertEq(success, false);
|
||||
@ -82,7 +80,6 @@ contract ZRXTokenTest is Test {
|
||||
function testShouldReturnFalseIfRecipientHasInsufficientAllowance() public {
|
||||
vm.prank(owner);
|
||||
zrxToken.approve(user, totalSupply - 1);
|
||||
vm.stopPrank();
|
||||
|
||||
bool success = zrxToken.transferFrom(owner, user, totalSupply);
|
||||
assertEq(success, false);
|
||||
@ -97,7 +94,6 @@ contract ZRXTokenTest is Test {
|
||||
function testShouldNotModifySenderAllowanceIfSetToUINT256Max() public {
|
||||
vm.prank(owner);
|
||||
zrxToken.approve(user, type(uint256).max);
|
||||
vm.stopPrank();
|
||||
|
||||
zrxToken.transferFrom(owner, user, 100);
|
||||
assertEq(zrxToken.allowance(owner, user), type(uint256).max);
|
||||
@ -106,7 +102,6 @@ contract ZRXTokenTest is Test {
|
||||
function testShouldTransferCorrectlyWhenSufficientAllowance() public {
|
||||
vm.prank(owner);
|
||||
zrxToken.approve(user, 1000 * 1e18);
|
||||
vm.stopPrank();
|
||||
|
||||
vm.prank(user);
|
||||
zrxToken.transferFrom(owner, user, 100 * 1e18);
|
||||
|
@ -90,7 +90,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -155,7 +154,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -266,7 +264,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -330,7 +327,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -366,7 +362,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -402,7 +397,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
@ -438,7 +432,6 @@ abstract contract ZeroExGovernorBaseTest is BaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
|
@ -70,13 +70,12 @@ contract ZeroExProtocolGovernorTest is ZeroExGovernorBaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
vm.prank(account3);
|
||||
governor.castVote(proposalId, 0); // Vote "against"
|
||||
vm.stopPrank();
|
||||
|
||||
vm.prank(account4);
|
||||
governor.castVote(proposalId, 2); // Vote "abstain"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
|
@ -66,13 +66,12 @@ contract ZeroExTreasuryGovernorTest is ZeroExGovernorBaseTest {
|
||||
// Vote
|
||||
vm.prank(account2);
|
||||
governor.castVote(proposalId, 1); // Vote "for"
|
||||
vm.stopPrank();
|
||||
|
||||
vm.prank(account3);
|
||||
governor.castVote(proposalId, 0); // Vote "against"
|
||||
vm.stopPrank();
|
||||
|
||||
vm.prank(account4);
|
||||
governor.castVote(proposalId, 2); // Vote "abstain"
|
||||
vm.stopPrank();
|
||||
|
||||
// Fast forward to vote end
|
||||
vm.roll(governor.proposalDeadline(proposalId) + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user