Skip to content

Commit

Permalink
Merge branch 'develop' into reafactor/crypto-transaction/use-chainId
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastijankuzner committed Jan 28, 2025
2 parents 6865d44 + 4e14b94 commit 97d1411
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions contracts/test/multi-payment/MultiPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,22 +219,25 @@ contract MultiPaymentTest is Test {
multiPayment.pay{value: 40 ether}(recipients, amounts);
}

function test_pay_fail_if_no_enough_balance() public {
address payable sender = payable(address(this));
vm.deal(sender, 100 ether);
assertEq(sender.balance, 100 ether);
// Test disabled, because of foundy updates. Check:
// https://book.getfoundry.sh/cheatcodes/expect-revert#description

address payable recipient = payable(address(1));
assertEq(recipient.balance, 0);
// function test_pay_fail_if_no_enough_balance() public {
// address payable sender = payable(address(this));
// vm.deal(sender, 100 ether);
// assertEq(sender.balance, 100 ether);

address payable[] memory recipients = new address payable[](1);
recipients[0] = recipient;
// address payable recipient = payable(address(1));
// assertEq(recipient.balance, 0);

uint256[] memory amounts = new uint256[](1);
amounts[0] = 10 ether;
// address payable[] memory recipients = new address payable[](1);
// recipients[0] = recipient;

// Act
vm.expectRevert();
multiPayment.pay{value: 110 ether}(recipients, amounts);
}
// uint256[] memory amounts = new uint256[](1);
// amounts[0] = 10 ether;

// // Act
// vm.expectRevert();
// multiPayment.pay{value: 110 ether}(recipients, amounts);
// }
}

0 comments on commit 97d1411

Please sign in to comment.