Skip to content

Commit

Permalink
add native currency v4 pool and v3 pool to new mixed route unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 committed Sep 19, 2024
1 parent dba4d4d commit 8e09d34
Showing 1 changed file with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,28 @@ import {
import {
DAI_ETH_V4_MEDIUM,
DAI_USDT,
DAI_USDT_LOW, DAI_USDT_V4_LOW, ETH_USDT_V4_LOW, UNI_ETH_V4_MEDIUM,
DAI_USDT_LOW,
DAI_USDT_V4_LOW,
ETH_USDT_V4_LOW,
UNI_ETH_V4_MEDIUM,
UNI_WETH_MEDIUM,
USDC_DAI,
USDC_DAI_LOW,
USDC_DAI_MEDIUM, USDC_DAI_V4_LOW, USDC_DAI_V4_MEDIUM, USDC_ETH_V4_LOW,
USDC_DAI_MEDIUM,
USDC_DAI_V4_LOW,
USDC_DAI_V4_MEDIUM,
USDC_ETH_V4_LOW,
USDC_USDT,
USDC_WETH,
USDC_WETH_LOW, USDC_WETH_V4_LOW,
USDC_WETH_LOW,
USDC_WETH_V4_LOW,
WBTC_WETH,
WETH9_USDT_LOW, WETH9_USDT_V4_LOW,
WETH9_USDT_LOW,
WETH9_USDT_V4_LOW,
WETH_USDT
} from '../../../../test-util/mock-data';
import { ADDRESS_ZERO } from '@uniswap/router-sdk';
import { ChainId, WETH9 } from '@uniswap/sdk-core';

describe('compute all v4 routes', () => {
test('succeeds to compute all routes', async () => {
Expand Down Expand Up @@ -270,6 +280,17 @@ describe('compute all mixed routes', () => {

expect(routes).toHaveLength(0);
});

test('succeeds to compute native currency routes', async () => {
const pools = [
ETH_USDT_V4_LOW,
UNI_ETH_V4_MEDIUM,
UNI_WETH_MEDIUM,
];
const routes = computeAllMixedRoutes(USDT, WETH9[ChainId.MAINNET]!, pools, 3);

expect(routes).toHaveLength(1);
});
});

describe('compute all v2 routes', () => {
Expand Down

0 comments on commit 8e09d34

Please sign in to comment.