Skip to content

Commit

Permalink
fix invariant by ensuring signer has enough ether before adding deposit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aboudjem committed May 20, 2024
1 parent c646604 commit 50ca521
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/foundry/invariant/test/BaseAccountInvariantTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ contract BaseAccountInvariantTest is NexusTest_Base {

// Deposit 1 ether to nexusAccount from signer.
vm.prank(signer.addr);
nexusAccount.addDeposit{ value: 1 ether }();
vm.deal(signer.addr, 100 ether); // Ensure signer has enough ether
nexusAccount.addDeposit{ value: depositAmount }();

// Check if the deposit reflects correctly within the tolerance
uint256 postDepositBalance = nexusAccount.getDeposit();
Expand Down

0 comments on commit 50ca521

Please sign in to comment.