From a060bf107935f6ef15c758d7462ab9a6160e8fa4 Mon Sep 17 00:00:00 2001 From: eddie <66155195+just-toby@users.noreply.github.com> Date: Wed, 2 Aug 2023 12:06:04 -0700 Subject: [PATCH] fix: remove unused variable (#7061) --- src/lib/hooks/useTokenList/fetchTokenList.test.ts | 7 ++++--- src/lib/hooks/useTokenList/fetchTokenList.ts | 2 -- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/lib/hooks/useTokenList/fetchTokenList.test.ts b/src/lib/hooks/useTokenList/fetchTokenList.test.ts index 2441963bcf..0d01345c35 100644 --- a/src/lib/hooks/useTokenList/fetchTokenList.test.ts +++ b/src/lib/hooks/useTokenList/fetchTokenList.test.ts @@ -1,7 +1,8 @@ import defaultTokenList from '@uniswap/default-token-list' +import { UNI_LIST } from 'constants/lists' import fetch from 'jest-fetch-mock' -import fetchTokenList, { DEFAULT_TOKEN_LIST } from './fetchTokenList' +import fetchTokenList from './fetchTokenList' fetch.enableMocks() @@ -71,8 +72,8 @@ describe('fetchTokenList', () => { }) it('fetches and validates the default token list', async () => { - fetch.mockOnceIf(DEFAULT_TOKEN_LIST, () => Promise.resolve(JSON.stringify(defaultTokenList))) - await expect(fetchTokenList(DEFAULT_TOKEN_LIST, resolver)).resolves.toStrictEqual(defaultTokenList) + fetch.mockOnceIf(UNI_LIST, () => Promise.resolve(JSON.stringify(defaultTokenList))) + await expect(fetchTokenList(UNI_LIST, resolver)).resolves.toStrictEqual(defaultTokenList) expect(resolver).not.toHaveBeenCalled() }) diff --git a/src/lib/hooks/useTokenList/fetchTokenList.ts b/src/lib/hooks/useTokenList/fetchTokenList.ts index 3d46b578fe..be7ff8bffe 100644 --- a/src/lib/hooks/useTokenList/fetchTokenList.ts +++ b/src/lib/hooks/useTokenList/fetchTokenList.ts @@ -4,8 +4,6 @@ import parseENSAddress from 'lib/utils/parseENSAddress' import uriToHttp from 'lib/utils/uriToHttp' import { validateTokenList } from 'utils/validateTokenList' -export const DEFAULT_TOKEN_LIST = 'https://gateway.ipfs.io/ipns/tokens.uniswap.org' - const listCache = new Map() /**