Skip to content

Commit

Permalink
fix: add failing test + minor
Browse files Browse the repository at this point in the history
  • Loading branch information
JackieJoo committed Jan 28, 2025
1 parent 0565996 commit e7e18f7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 33 deletions.
35 changes: 3 additions & 32 deletions src/dex/fluid-dex/fluid-dex-e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,6 @@ import { CollateralReserves, DebtReserves, DexLimits } from './types';
import { DummyDexHelper } from '../../dex-helper/index';
import { FluidDex } from './fluid-dex';

/*
README
======
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 FluidDex 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 FluidDex (Eg. Tests based on poolType, special tokens,
etc).
You can run this individual test script by running:
`npx jest src/dex/<dex-name>/<dex-name>-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,
Expand Down Expand Up @@ -181,11 +152,11 @@ describe('FluidDex E2E', () => {
describe('Mainnet', () => {
const network = Network.MAINNET;

describe('FLUID -> ETH', () => {
describe('failing:FLUID -> ETH', () => {
const tokenASymbol: string = 'FLUID';
const tokenBSymbol: string = 'ETH';
const tokenAAmount: string = '16009704732';
const tokenBAmount: string = '7992306000001';
const tokenAAmount: string = '160097047322810379';
const tokenBAmount: string = '79923068733005505624';

testForNetwork(
network,
Expand Down
2 changes: 1 addition & 1 deletion tests/constants-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ export const Holders: {
BB_sUSDe: '0xaFeb95DEF3B2A3D532D74DaBd51E62048d6c07A4',
AA_iETHv2: '0xA118aD79E2152b9a3c7Df8B8791887762b0f1D49',
BB_iETHv2: '0x15079cBAa74C1df2a602fAc88Bd5b98B08FfE6A4',
ETH: '0x176F3DAb24a159341c0509bB36B833E7fdd0a132',
ETH: '0x28C6c06298d514Db089934071355E5743bf21d60',
USDC: '0x7713974908be4bed47172370115e8b1219f4a5f0',
USDE: '0x8707f238936c12c309bfc2B9959C35828AcFc512',
AMPL: '0x223592a191ECfC7FDC38a9256c3BD96E771539A9',
Expand Down
1 change: 1 addition & 0 deletions tests/tenderly-simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ export class TenderlySimulation implements TransactionSimulator {
};
}
} catch (e) {
console.error('TenderlySimulation_simulate_error', e);
return {
success: false,
};
Expand Down

0 comments on commit e7e18f7

Please sign in to comment.