fix: Test+formatting fixes after rebase.

This commit is contained in:
TAMARA LIPOWSKI
2025-04-14 12:38:29 -04:00
committed by Diana Carvalho
parent a301a1cef3
commit e96ea1b10b
7 changed files with 35 additions and 53 deletions

View File

@@ -90,7 +90,9 @@ contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
assertEq(receiver, address(2));
assertEq(target, address(3));
assertEq(zeroForOne, false);
assertEq(uint8(transferType), uint8(TokenTransfer.TransferType.TRANSFER));
assertEq(
uint8(transferType), uint8(TokenTransfer.TransferType.TRANSFER)
);
}
function testDecodeParamsInvalidDataLength() public {
@@ -121,7 +123,11 @@ contract UniswapV3ExecutorTest is Test, Constants, Permit2TestHelper {
vm.startPrank(DAI_WETH_USV3);
bytes memory protocolData = abi.encodePacked(
WETH_ADDR, DAI_ADDR, poolFee, TokenTransfer.TransferType.TRANSFER
WETH_ADDR,
DAI_ADDR,
poolFee,
TokenTransfer.TransferType.TRANSFER,
address(uniswapV3Exposed)
);
uint256 dataOffset = 3; // some offset
uint256 dataLength = protocolData.length;

View File

@@ -108,11 +108,7 @@ contract UniswapV4ExecutorTest is Test, Constants {
});
bytes memory data = UniswapV4Utils.encodeExactInput(
USDE_ADDR,
USDT_ADDR,
true,
TokenTransfer.TransferType.NONE,
pools
USDE_ADDR, USDT_ADDR, true, TokenTransfer.TransferType.NONE, pools
);
uint256 amountOut = uniswapV4Exposed.swap(amountIn, data);
@@ -128,7 +124,7 @@ contract UniswapV4ExecutorTest is Test, Constants {
// USDE -> USDT
// Generated by the Tycho swap encoder - test_encode_uniswap_v4_simple_swap
bytes memory protocolData =
hex"4c9edd5852cd905f086c759e8383e09bff1e68b3dac17f958d2ee523a2206206994597c13d831ec701f62849f9a0b5bf2913b396098f7c7019b51a820a00dac17f958d2ee523a2206206994597c13d831ec7000064000001";
hex"4c9edd5852cd905f086c759e8383e09bff1e68b3dac17f958d2ee523a2206206994597c13d831ec70100dac17f958d2ee523a2206206994597c13d831ec7000064000001";
uint256 amountIn = 100 ether;
deal(USDE_ADDR, address(uniswapV4Exposed), amountIn);
uint256 usdeBalanceBeforePool = USDE.balanceOf(poolManager);
@@ -166,11 +162,7 @@ contract UniswapV4ExecutorTest is Test, Constants {
});
bytes memory data = UniswapV4Utils.encodeExactInput(
USDE_ADDR,
WBTC_ADDR,
true,
TokenTransfer.TransferType.NONE,
pools
USDE_ADDR, WBTC_ADDR, true, TokenTransfer.TransferType.NONE, pools
);
uint256 amountOut = uniswapV4Exposed.swap(amountIn, data);
@@ -189,7 +181,7 @@ contract UniswapV4ExecutorTest is Test, Constants {
// Generated by the Tycho swap encoder - test_encode_uniswap_v4_sequential_swap
bytes memory protocolData =
hex"4c9edd5852cd905f086c759e8383e09bff1e68b32260fac5e5542a773aa44fbcfedf7c193bc2c59901f62849f9a0b5bf2913b396098f7c7019b51a820a00dac17f958d2ee523a2206206994597c13d831ec70000640000012260fac5e5542a773aa44fbcfedf7c193bc2c599000bb800003c";
hex"4c9edd5852cd905f086c759e8383e09bff1e68b32260fac5e5542a773aa44fbcfedf7c193bc2c5990100dac17f958d2ee523a2206206994597c13d831ec70000640000012260fac5e5542a773aa44fbcfedf7c193bc2c599000bb800003c";
uint256 amountIn = 100 ether;
deal(USDE_ADDR, address(uniswapV4Exposed), amountIn);

View File

@@ -23,11 +23,7 @@ library UniswapV4Utils {
}
return abi.encodePacked(
tokenIn,
tokenOut,
zeroForOne,
transferType,
encodedPools
tokenIn, tokenOut, zeroForOne, transferType, encodedPools
);
}
}