diff --git a/src/lib/tokenlist.spec.ts b/src/lib/tokenlist.spec.ts index 02c205ae0d5b..b97af36c034b 100644 --- a/src/lib/tokenlist.spec.ts +++ b/src/lib/tokenlist.spec.ts @@ -2,7 +2,13 @@ import fs from 'fs'; import test from 'ava'; -import { CLUSTER_SLUGS, ENV, Strategy, TokenListProvider } from './tokenlist'; +import { + CLUSTER_SLUGS, + ENV, + Strategy, + TokenInfo, + TokenListProvider, +} from './tokenlist'; test('Token list is filterable by a tag', async (t) => { const list = (await new TokenListProvider().resolve(Strategy.Static)) @@ -49,7 +55,7 @@ test('Token list throws error when calling filterByClusterSlug with slug that do ); }); -test('Token list ris a valid json', async (t) => { +test('Token list is a valid json', async (t) => { t.notThrows(() => { const content = fs .readFileSync('./src/tokens/solana.tokenlist.json') @@ -57,3 +63,19 @@ test('Token list ris a valid json', async (t) => { JSON.parse(content.toString()); }); }); + +test('Token list does not have duplicate entries', async (t) => { + const list = await new TokenListProvider().resolve(Strategy.Static); + list + .filterByChainId(ENV.MainnetBeta) + .getList() + .reduce((agg, item) => { + if (agg.has(item.address)) { + console.log(item.address); + } + + t.false(agg.has(item.address)); + agg.set(item.address, item); + return agg; + }, new Map()); +}); diff --git a/src/tokens/solana.tokenlist.json b/src/tokens/solana.tokenlist.json index 062a046b0daa..5fe79bde1bbb 100644 --- a/src/tokens/solana.tokenlist.json +++ b/src/tokens/solana.tokenlist.json @@ -6778,18 +6778,6 @@ "website": "https://solanium.io/" } }, - { - "chainId": 101, - "address": "Ae1aeYK9WrB2kP29jJU4aUUK7Y1vzsGNZFKoe4BG2h6P", - "symbol": "NINJA", - "name": "NINJA", - "decimals": 0, - "logoURI": "https://raw.githubusercontent.com/yuzu-ninjaprotocol/ninjaprotocol/main/NINJA%20Token.svg", - "tags": [], - "extensions": { - "website": "http://ninjaprotocol.io" - } - }, { "chainId": 101, "address": "8GPUjUHFxfNhaSS8kUkix8txRRXszeUAsHTjUmHuygZT",