From 7f8e1e6e3b09a23384bd6ef0e7b02e4bb5ae2da2 Mon Sep 17 00:00:00 2001 From: pedrobergamini <41773103+pedrobergamini@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:00:12 -0300 Subject: [PATCH] chore: assert exact eth balance at aggregate test --- foundry/test/protocols/Bebop.t.sol | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/foundry/test/protocols/Bebop.t.sol b/foundry/test/protocols/Bebop.t.sol index 0e50099..63faf7f 100644 --- a/foundry/test/protocols/Bebop.t.sol +++ b/foundry/test/protocols/Bebop.t.sol @@ -479,12 +479,11 @@ contract BebopExecutorTest is Constants, Permit2TestHelper, TestUtils { totalMakerAmount, "USDC should be at receiver" ); - // ETH balance check - the harness may have different balance due to test setup - // Just ensure no excessive ETH is stuck - assertLe( + // With pranking, settlement pulls ETH from taker; executor keeps msg.value + assertEq( address(bebopExecutor).balance, - initialExecutorBalance + 1 ether, - "Too much ETH left in executor" + totalTakerAmount, + "Executor ETH balance should equal msg.value for aggregate ETH flow" ); } @@ -625,12 +624,11 @@ contract BebopExecutorTest is Constants, Permit2TestHelper, TestUtils { expectedPartialOutput, "USDC should be at receiver" ); - // ETH balance check - the harness may have different balance due to test setup - // Just ensure no excessive ETH is stuck - assertLe( + // With pranking, settlement pulls ETH from taker; executor keeps msg.value + assertEq( address(bebopExecutor).balance, - initialExecutorBalance + 1 ether, - "Too much ETH left in executor" + partialFillAmount, + "Executor ETH balance should equal msg.value for aggregate ETH flow" ); }