Skip to content

Commit

Permalink
test contribution reverts
Browse files Browse the repository at this point in the history
  • Loading branch information
arr00 committed Sep 11, 2023
1 parent ea68ed4 commit 9b5f379
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions test/crowdfund/ContributionRouterIntegration.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,27 @@ contract ContributionRouterIntegrationTest is TestUtils {
assertEq(member.balance, 0);
}

function test_contributionFee_ethCrowdfund_revert() public {
// Setup for contribution.
address payable member = _randomAddress();
uint256 amount = 1 ether;
vm.deal(member, amount);
bytes memory data = abi.encodeCall(
InitialETHCrowdfund.contributeFor,
(0, member, address(0), "")
);

// Make contribution.
vm.prank(member);
(bool success, bytes memory res) = address(router).call{ value: amount }(
abi.encodePacked(data, ethCrowdfund)
);

// Check results.
assertEq(success, false);
assertEq(bytes4(res), ETHCrowdfundBase.InvalidDelegateError.selector);
}

function test_contributionFee_ethCrowdfund_withBatchMint() public {
// Setup for contribution.
address payable member = _randomAddress();
Expand Down

0 comments on commit 9b5f379

Please sign in to comment.