fix: After rebase fixes

- In Tycho Router
  - Fix integration tests
  - If the trade is cyclical, we can't do the balance check for the correctness of the amountOut transfers
- In encoding,
  - if it is a wrap trade, the transfer should be just a normal Transfer (not TransferFrom nor a Permit2Transfer)
  - add test names to println! statements

--- don't change below this line ---
ENG-4315 Took 1 hour 0 minutes

Took 30 seconds

Took 21 seconds

Took 16 seconds


Took 17 seconds
This commit is contained in:
Diana Carvalho
2025-04-15 18:27:19 +01:00
parent ec87969aa6
commit 8145f416b7
11 changed files with 132 additions and 97 deletions

View File

@@ -44,7 +44,11 @@ contract TychoRouterSplitSwapTest is TychoRouterTestSetup {
uint8(2),
uint24(0),
address(usv2Executor),
encodeUniswapV2Swap(WBTC_ADDR, USDC_WBTC_POOL, ALICE, true,
encodeUniswapV2Swap(
WBTC_ADDR,
USDC_WBTC_POOL,
ALICE,
true,
TokenTransfer.TransferType.TRANSFER_TO_PROTOCOL
)
);
@@ -261,10 +265,11 @@ contract TychoRouterSplitSwapTest is TychoRouterTestSetup {
spender: address(0),
sigDeadline: 0
});
bytes memory protocolData =
encodeUniswapV2Swap(WETH_ADDR,
bytes memory protocolData = encodeUniswapV2Swap(
WETH_ADDR,
WETH_DAI_POOL,
ALICE, false,
ALICE,
false,
TokenTransfer.TransferType.TRANSFER_TO_PROTOCOL
);
@@ -472,7 +477,12 @@ contract TychoRouterSplitSwapTest is TychoRouterTestSetup {
});
bytes memory protocolData = UniswapV4Utils.encodeExactInput(
USDE_ADDR, WBTC_ADDR, true, TokenTransfer.TransferType.NONE, ALICE, pools
USDE_ADDR,
WBTC_ADDR,
true,
TokenTransfer.TransferType.NONE,
ALICE,
pools
);
bytes memory swap = encodeSplitSwap(