From 4454eee7ed25d1f17daef11d6a5dff293f4a0ffe Mon Sep 17 00:00:00 2001 From: Dong-Ha Kim Date: Mon, 24 Nov 2025 16:12:03 +0700 Subject: [PATCH] test: use stables for e2e swap tests attempt to make e2e tests less prone to slippage related reverts. --- e2e-api/swap/execute-approval.test.ts | 30 ++++++++++++++------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/e2e-api/swap/execute-approval.test.ts b/e2e-api/swap/execute-approval.test.ts index dfae812c7..91f6e6537 100644 --- a/e2e-api/swap/execute-approval.test.ts +++ b/e2e-api/swap/execute-approval.test.ts @@ -16,6 +16,14 @@ const SWAP_API_URL = `${SWAP_API_BASE_URL}/api/swap/approval`; const TOKEN_FUND_AMOUNT = 1_000_000; // Unparsed amount of tokens to fund the depositor and relayer, e.g. 1_000_000 USDC const SLIPPAGE = "auto"; +const USDS = { + symbol: "USDS", + decimals: 18, + addresses: { + [CHAIN_IDs.BASE]: "0x820C137fa70C8691f0e44Dc420a5e53c168921Dc", + }, +}; + const B2B_BASE_TEST_CASE = { amounts: { exactInput: parseUnits("1", 6), // 1 USDC @@ -32,11 +40,11 @@ const B2B_BASE_TEST_CASE = { const B2A_BASE_TEST_CASE = { amounts: { exactInput: parseUnits("1", 6), // 1 USDC - exactOutput: parseUnits("1", 18), // 1 OP - minOutput: parseUnits("1", 18), // 1 OP + exactOutput: parseUnits("1", 6), // 1 USDC.e + minOutput: parseUnits("1", 6), // 1 USDC.e }, inputToken: TOKEN_SYMBOLS_MAP.USDC, - outputToken: TOKEN_SYMBOLS_MAP.OP, + outputToken: TOKEN_SYMBOLS_MAP["USDC.e"], originChainId: CHAIN_IDs.BASE, destinationChainId: CHAIN_IDs.OPTIMISM, slippage: SLIPPAGE, @@ -44,11 +52,11 @@ const B2A_BASE_TEST_CASE = { const A2B_BASE_TEST_CASE = { amounts: { - exactInput: parseUnits("1", 18), // 1 OP + exactInput: parseUnits("1", 6), // 1 USDC.e exactOutput: parseUnits("1", 6), // 1 USDC minOutput: parseUnits("1", 6), // 1 USDC }, - inputToken: TOKEN_SYMBOLS_MAP.OP, + inputToken: TOKEN_SYMBOLS_MAP["USDC.e"], outputToken: TOKEN_SYMBOLS_MAP.USDC, originChainId: CHAIN_IDs.OPTIMISM, destinationChainId: CHAIN_IDs.BASE, @@ -57,18 +65,12 @@ const A2B_BASE_TEST_CASE = { const A2A_BASE_TEST_CASE = { amounts: { - exactInput: parseUnits("1", 18), // 1 OP + exactInput: parseUnits("1", 6), // 1 USDC.e exactOutput: parseUnits("1", 18), // 1 USDS minOutput: parseUnits("1", 18), // 1 USDS }, - inputToken: TOKEN_SYMBOLS_MAP.OP, - outputToken: { - symbol: "USDS", - decimals: 18, - addresses: { - [CHAIN_IDs.BASE]: "0x820C137fa70C8691f0e44Dc420a5e53c168921Dc", - }, - }, + inputToken: TOKEN_SYMBOLS_MAP["USDC.e"], + outputToken: USDS, originChainId: CHAIN_IDs.OPTIMISM, destinationChainId: CHAIN_IDs.BASE, slippage: SLIPPAGE,