diff --git a/src/dex/angle-staked-stable/angle-staked-stable-e2e.test.ts b/src/dex/angle-staked-stable/angle-staked-stable-e2e.test.ts index ca78ba024..99cd65ba8 100644 --- a/src/dex/angle-staked-stable/angle-staked-stable-e2e.test.ts +++ b/src/dex/angle-staked-stable/angle-staked-stable-e2e.test.ts @@ -12,45 +12,6 @@ import { Network, ContractMethod, SwapSide } from '../../constants'; import { StaticJsonRpcProvider } from '@ethersproject/providers'; import { generateConfig } from '../../config'; -/* - README - ====== - - This test script should add e2e tests for AngleStakedStable. The tests - should cover as many cases as possible. Most of the DEXes follow - the following test structure: - - DexName - - ForkName + Network - - ContractMethod - - ETH -> Token swap - - Token -> ETH swap - - Token -> Token swap - - The template already enumerates the basic structure which involves - testing simpleSwap, multiSwap, megaSwap contract methods for - ETH <> TOKEN and TOKEN <> TOKEN swaps. You should replace tokenA and - tokenB with any two highly liquid tokens on AngleStakedStable for the tests - to work. If the tokens that you would like to use are not defined in - Tokens or Holders map, you can update the './tests/constants-e2e' - - Other than the standard cases that are already added by the template - it is highly recommended to add test cases which could be specific - to testing AngleStakedStable (Eg. Tests based on poolType, special tokens, - etc). - - You can run this individual test script by running: - `npx jest src/dex//-e2e.test.ts` - - e2e tests use the Tenderly fork api. Please add the following to your - .env file: - TENDERLY_TOKEN=Find this under Account>Settings>Authorization. - TENDERLY_ACCOUNT_ID=Your Tenderly account name. - TENDERLY_PROJECT=Name of a Tenderly project you have created in your - dashboard. - - (This comment should be removed from the final implementation) -*/ - function testForNetwork( network: Network, dexKey: string, @@ -91,6 +52,19 @@ function testForNetwork( provider, ); }); + it(`${tokenBSymbol} -> ${tokenASymbol}`, async () => { + await testE2E( + tokens[tokenBSymbol], + tokens[tokenASymbol], + holders[tokenBSymbol], + side === SwapSide.SELL ? tokenBAmount : tokenAAmount, + side, + dexKey, + contractMethod, + network, + provider, + ); + }); }); }); }), @@ -101,7 +75,7 @@ function testForNetwork( describe('AngleStakedStable E2E', () => { const dexKey = 'AngleStakedStable'; - describe('Mainnet - agEUR -> stEUR', () => { + describe('Mainnet', () => { const network = Network.MAINNET; const tokenASymbol: string = 'agEUR'; @@ -111,26 +85,6 @@ describe('AngleStakedStable E2E', () => { const tokenBAmount: string = '1000000000000000000'; const nativeTokenAmount = '1000000000000000000'; - testForNetwork( - network, - dexKey, - tokenASymbol, - tokenBSymbol, - tokenAAmount, - tokenBAmount, - nativeTokenAmount, - ); - }); - describe('Mainnet - stEUR -> agEUR', () => { - const network = Network.MAINNET; - - const tokenASymbol: string = 'stEUR'; - const tokenBSymbol: string = 'agEUR'; - - const tokenAAmount: string = '1000000000000000000'; - const tokenBAmount: string = '1000000000000000000'; - const nativeTokenAmount = '1000000000000000000'; - testForNetwork( network, dexKey, diff --git a/tests/constants-e2e.ts b/tests/constants-e2e.ts index 354ee37fb..b3fae1454 100644 --- a/tests/constants-e2e.ts +++ b/tests/constants-e2e.ts @@ -1090,7 +1090,7 @@ export const Holders: { EURS: '0xC1056Adeb61a01964Ea265cA95EffB7016f9Ed78', EURT: '0x6914FC70fAC4caB20a8922E900C4BA57fEECf8E1', CRV: '0x7a16fF8270133F063aAb6C9977183D9e72835428', - jEUR: '0x4f0CF2F63913524b85c1126AB7eE7957857f3482', + jEUR: '0x937Df4e3d6dB229A10ff0098ab3A1bCC40C33ea4', UST: '0xf16e9b0d03470827a95cdfd0cb8a8a3b46969b91', SAITAMA: '0x763d5d93f27615aac852b70549f5877b92193864', aETH: '0xc03c4476fbe25138bf724fa1b95551c6e6b8fd2c', diff --git a/tests/utils-e2e.ts b/tests/utils-e2e.ts index ba76b010a..82e0b8e00 100644 --- a/tests/utils-e2e.ts +++ b/tests/utils-e2e.ts @@ -119,7 +119,7 @@ class APIParaswapSDK implements IParaSwapSDK { amount: amount.toString(), options: { includeDEXS: [this.dexKey], - includeContractMethods: [contractMethod], + includeContractMethods: [contractMethod as any], partner: 'any', }, srcDecimals: from.decimals,