Skip to content

Commit

Permalink
test: ensure verify asks for ERC20 balances
Browse files Browse the repository at this point in the history
  • Loading branch information
0xteddybear committed Jul 17, 2024
1 parent 068e06f commit 56dcaa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion test/unit/BCoWPool/BCoWPool_Verify.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ contract BCoWPoolVerify is BCoWPoolBase {
function test_WhenPreconditionsAreMet(uint256 _sellAmount) external {
_sellAmount = bound(_sellAmount, 0, validOrder.sellAmount);
validOrder.sellAmount = _sellAmount;
// it should return
// it should ask the balance of the buy token
vm.expectCall(tokenIn, abi.encodeCall(IERC20.balanceOf, (address(bCoWPool))));
// it should ask the balance of the sell token
vm.expectCall(tokenOut, abi.encodeCall(IERC20.balanceOf, (address(bCoWPool))));
bCoWPool.verify(validOrder);
}
}
3 changes: 2 additions & 1 deletion test/unit/BCoWPool/BCoWPool_Verify.tree
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ BCoWPool::Verify
├── when calculated token amount out is less than order sell amount
│ └── it should revert
└── when preconditions are met
└── it should return
├── it should ask the balance of the buy token
└── it should ask the balance of the sell token

0 comments on commit 56dcaa8

Please sign in to comment.