From 9a1851038d7b055ba34efefae5c83bcc201206b1 Mon Sep 17 00:00:00 2001 From: johngrantuk Date: Wed, 1 Mar 2023 14:37:43 +0000 Subject: [PATCH] Add proper type to match Swaps. --- src/pools/lido/index.ts | 270 +++++++++++++++++++++------------------- test/lido.spec.ts | 128 +++++++++---------- 2 files changed, 205 insertions(+), 193 deletions(-) diff --git a/src/pools/lido/index.ts b/src/pools/lido/index.ts index c01e67e2..a386a022 100644 --- a/src/pools/lido/index.ts +++ b/src/pools/lido/index.ts @@ -54,7 +54,19 @@ export const Lido = { }, }; -export const Routes = { +type Route = { + name: string; + tokenInDecimals: number; + tokenOutDecimals: number; + tokenAddresses: string[]; + swaps: SwapV2[]; +}; + +type RouteMap = { + [id: string]: Route; +}; + +export const Routes: { [network: number]: RouteMap } = { 1: {}, 42: {}, }; @@ -70,15 +82,15 @@ Routes[1][`${Lido.DAI[1]}${Lido.wstETH[1]}0`] = { { poolId: Lido.StaticPools.wethDai[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, ], @@ -94,15 +106,15 @@ Routes[1][`${Lido.wstETH[1]}${Lido.DAI[1]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, ], @@ -118,15 +130,15 @@ Routes[1][`${Lido.DAI[1]}${Lido.wstETH[1]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -142,15 +154,15 @@ Routes[1][`${Lido.wstETH[1]}${Lido.DAI[1]}1`] = { { poolId: Lido.StaticPools.wethDai[1], amount: '', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -166,22 +178,22 @@ Routes[1][`${Lido.USDC[1]}${Lido.wstETH[1]}0`] = { { poolId: Lido.StaticPools.staBal[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -196,22 +208,22 @@ Routes[1][`${Lido.USDC[1]}${Lido.wstETH[1]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -227,22 +239,22 @@ Routes[1][`${Lido.wstETH[1]}${Lido.USDC[1]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[1], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -257,22 +269,22 @@ Routes[1][`${Lido.wstETH[1]}${Lido.USDC[1]}1`] = { { poolId: Lido.StaticPools.staBal[1], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -288,22 +300,22 @@ Routes[1][`${Lido.USDT[1]}${Lido.wstETH[1]}0`] = { { poolId: Lido.StaticPools.staBal[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -318,22 +330,22 @@ Routes[1][`${Lido.USDT[1]}${Lido.wstETH[1]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -349,22 +361,22 @@ Routes[1][`${Lido.wstETH[1]}${Lido.USDT[1]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[1], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[1], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -379,22 +391,22 @@ Routes[1][`${Lido.wstETH[1]}${Lido.USDT[1]}1`] = { { poolId: Lido.StaticPools.staBal[1], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[1], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[1], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -411,15 +423,15 @@ Routes[42][`${Lido.USDC[42]}${Lido.wstETH[42]}0`] = { { poolId: Lido.StaticPools.wethDai[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, ], @@ -435,15 +447,15 @@ Routes[42][`${Lido.wstETH[42]}${Lido.USDC[42]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, ], @@ -459,15 +471,15 @@ Routes[42][`${Lido.USDC[42]}${Lido.wstETH[42]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -483,15 +495,15 @@ Routes[42][`${Lido.wstETH[42]}${Lido.USDC[42]}1`] = { { poolId: Lido.StaticPools.wethDai[42], amount: '', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -512,22 +524,22 @@ Routes[42][`${Lido.DAI[42]}${Lido.wstETH[42]}0`] = { { poolId: Lido.StaticPools.staBal[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -547,22 +559,22 @@ Routes[42][`${Lido.DAI[42]}${Lido.wstETH[42]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -583,22 +595,22 @@ Routes[42][`${Lido.wstETH[42]}${Lido.DAI[42]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[42], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -618,22 +630,22 @@ Routes[42][`${Lido.wstETH[42]}${Lido.DAI[42]}1`] = { { poolId: Lido.StaticPools.staBal[42], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -654,22 +666,22 @@ Routes[42][`${Lido.USDT[42]}${Lido.wstETH[42]}0`] = { { poolId: Lido.StaticPools.staBal[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -689,22 +701,22 @@ Routes[42][`${Lido.USDT[42]}${Lido.wstETH[42]}1`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], @@ -725,22 +737,22 @@ Routes[42][`${Lido.wstETH[42]}${Lido.USDT[42]}0`] = { { poolId: Lido.StaticPools.wstEthWeth[42], amount: '', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.staBal[42], amount: '0', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, ], @@ -760,22 +772,22 @@ Routes[42][`${Lido.wstETH[42]}${Lido.USDT[42]}1`] = { { poolId: Lido.StaticPools.staBal[42], amount: '', - assetInIndex: '2', - assetOutIndex: '3', + assetInIndex: 2, + assetOutIndex: 3, userData: '0x', }, { poolId: Lido.StaticPools.wethDai[42], amount: '0', - assetInIndex: '1', - assetOutIndex: '2', + assetInIndex: 1, + assetOutIndex: 2, userData: '0x', }, { poolId: Lido.StaticPools.wstEthWeth[42], amount: '0', - assetInIndex: '0', - assetOutIndex: '1', + assetInIndex: 0, + assetOutIndex: 1, userData: '0x', }, ], diff --git a/test/lido.spec.ts b/test/lido.spec.ts index 85e01c26..7eff4c27 100644 --- a/test/lido.spec.ts +++ b/test/lido.spec.ts @@ -405,12 +405,12 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); expect(swapInfo.swaps[1].poolId).to.eq(poolLido); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -450,12 +450,12 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(1); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(2); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); - expect(swapInfo.swaps[1].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(0); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -492,12 +492,12 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -534,12 +534,12 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(1); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(2); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); expect(swapInfo.swaps[1].poolId).to.eq(poolLido); - expect(swapInfo.swaps[1].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(0); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -583,16 +583,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolLido); - expect(swapInfo.swaps[2].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(2); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(3); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -634,16 +634,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(2); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(3); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolStaBal); - expect(swapInfo.swaps[2].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(0); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -685,16 +685,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolStaBal); - expect(swapInfo.swaps[2].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(2); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(3); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -736,16 +736,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(2); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(3); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolLido); - expect(swapInfo.swaps[2].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(0); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -789,16 +789,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolLido); - expect(swapInfo.swaps[2].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(2); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(3); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -840,16 +840,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(2); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(3); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolStaBal); - expect(swapInfo.swaps[2].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(0); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -892,16 +892,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(0); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(1); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolStaBal); - expect(swapInfo.swaps[2].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(2); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(3); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true; @@ -946,16 +946,16 @@ describe(`Tests for Lido USD routes.`, () => { expect(swapInfo.swaps[0].amount.toString()).to.eq( swapAmt.toString() ); - expect(swapInfo.swaps[0].assetInIndex).to.eq('2'); - expect(swapInfo.swaps[0].assetOutIndex).to.eq('3'); + expect(swapInfo.swaps[0].assetInIndex).to.eq(2); + expect(swapInfo.swaps[0].assetOutIndex).to.eq(3); expect(swapInfo.swaps[1].poolId).to.eq(poolWethDai); expect(swapInfo.swaps[1].amount.toString()).to.eq('0'); - expect(swapInfo.swaps[1].assetInIndex).to.eq('1'); - expect(swapInfo.swaps[1].assetOutIndex).to.eq('2'); + expect(swapInfo.swaps[1].assetInIndex).to.eq(1); + expect(swapInfo.swaps[1].assetOutIndex).to.eq(2); expect(swapInfo.swaps[2].amount.toString()).to.eq('0'); expect(swapInfo.swaps[2].poolId).to.eq(poolLido); - expect(swapInfo.swaps[2].assetInIndex).to.eq('0'); - expect(swapInfo.swaps[2].assetOutIndex).to.eq('1'); + expect(swapInfo.swaps[2].assetInIndex).to.eq(0); + expect(swapInfo.swaps[2].assetOutIndex).to.eq(1); // This is pulled from mainnet so needs valid routes expect(swapInfo.returnAmount.gt(0)).to.be.true; expect(swapInfo.returnAmountConsideringFees.gt(0)).to.be.true;