test: update test_split_input_cyclic_swap to use usv2 in the last swap

This commit is contained in:
royvardhan
2025-03-11 00:18:38 +05:30
parent 0edc201f06
commit bd504a8fed
2 changed files with 5 additions and 6 deletions

View File

@@ -1350,7 +1350,6 @@ contract TychoRouterTest is TychoRouterTestSetup {
vm.stopPrank(); vm.stopPrank();
} }
function testCyclicSplitInputSwapIntegration() public { function testCyclicSplitInputSwapIntegration() public {
deal(USDC_ADDR, ALICE, 100 * 10 ** 6); deal(USDC_ADDR, ALICE, 100 * 10 ** 6);
@@ -1363,10 +1362,10 @@ contract TychoRouterTest is TychoRouterTestSetup {
// `dD8559c917393FC8DD2b4dD289c52Ff445fDE1B0` with the one in this test // `dD8559c917393FC8DD2b4dD289c52Ff445fDE1B0` with the one in this test
// `2e234DAe75C793f67A35089C9d99245E1C58470b` // `2e234DAe75C793f67A35089C9d99245E1C58470b`
(bool success,) = tychoRouterAddr.call( (bool success,) = tychoRouterAddr.call(
hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005ebe468000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000067f6bb0c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067cf3514000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041593a2ab4137d6b2657b5d6ece56457ac5ddbc1846d18e331d1a48ef3921ae66d49769f33aff5e18e4e2c13ceb3b408903ba1e78c88bae53151046710cd441b651b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000014d006d00019999992e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d801006d01000000002e234dae75c793f67a35089c9d99245e1c58470bc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d80000000000000000000000000000000000000000" hex"d499aa880000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005ef619b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000cd09f75e2bf2a4d11f3ab23f1389fcc1621c0cc2000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000000000000000000000000000000000000067f6c08700000000000000000000000000000000000000000000000000000000000000000000000000000000000000003ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000000000000000000000000000000000000067cf3a8f000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000000000000000000000000000000000041f248bfa39e6801b4173cd4d61e5e5d0c31942eb3c194785f964a82b2c3e05b4b302bccc0924fa4c4ef90854e42865db11f458d3b6a62afddee833f3eb069cd521b000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000136006d00019999992e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc20001f43ede3eca2a72b3aecc820e955b36f38437d0139588e6a0c2ddd26feeb64f039a2c41296fcb3f564001006d00010000002e234dae75c793f67a35089c9d99245e1c58470ba0b86991c6218b36c1d19d4a2e9eb0ce3606eb48c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000bb83ede3eca2a72b3aecc820e955b36f38437d013958ad599c3a0ff1de082011efddc58f1908eb6e6d801005601000000005615deb798bb3e4dfa0139dfa1b3d433cc23b72fc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2b4e16d0168e52d35cacd2c6185b44281ec28c9dc3ede3eca2a72b3aecc820e955b36f38437d013950000000000000000000000"
); );
assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99693951); assertEq(IERC20(USDC_ADDR).balanceOf(ALICE), 99574171);
vm.stopPrank(); vm.stopPrank();
} }

View File

@@ -1364,9 +1364,9 @@ mod tests {
// WETH -> USDC (Pool 2) // WETH -> USDC (Pool 2)
let swap_weth_usdc_pool2 = Swap { let swap_weth_usdc_pool2 = Swap {
component: ProtocolComponent { component: ProtocolComponent {
id: "0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8".to_string(), /* USDC-WETH USV3 id: "0xB4e16d0168e52d35CaCD2c6185b44281Ec28C9Dc".to_string(), /* USDC-WETH USV2
* Pool 2 */ * Pool 2 */
protocol_system: "uniswap_v3".to_string(), protocol_system: "uniswap_v2".to_string(),
static_attributes: { static_attributes: {
let mut attrs = HashMap::new(); let mut attrs = HashMap::new();
attrs.insert( attrs.insert(
@@ -1396,7 +1396,7 @@ mod tests {
given_amount: BigUint::from_str("100000000").unwrap(), // 100 USDC (6 decimals) given_amount: BigUint::from_str("100000000").unwrap(), // 100 USDC (6 decimals)
checked_token: usdc.clone(), checked_token: usdc.clone(),
expected_amount: None, expected_amount: None,
checked_amount: Some(BigUint::from_str("99693951").unwrap()), /* Expected output from checked_amount: Some(BigUint::from_str("99574171").unwrap()), /* Expected output from
* test */ * test */
router_address: Bytes::from_str("0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395").unwrap(), router_address: Bytes::from_str("0x3Ede3eCa2a72B3aeCC820E955B36f38437D01395").unwrap(),
sender: Bytes::from_str("0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2").unwrap(), sender: Bytes::from_str("0xcd09f75E2BF2A4d11F3AB23f1389FcC1621c0cc2").unwrap(),