Commit ee0db4f2 authored by Ian Lapham's avatar Ian Lapham Committed by GitHub

fix list parsing on broken tokens (#85)

* fix list parsing on broken tokens

* revert to most recent changes
parent 1619386a
...@@ -61,8 +61,10 @@ export function listToTokenMap(list: TokenList): TokenAddressMap { ...@@ -61,8 +61,10 @@ export function listToTokenMap(list: TokenList): TokenAddressMap {
}) })
?.filter((x): x is TagInfo => Boolean(x)) ?? [] ?.filter((x): x is TagInfo => Boolean(x)) ?? []
const token = new WrappedTokenInfo(tokenInfo, tags) const token = new WrappedTokenInfo(tokenInfo, tags)
if (tokenMap[token.chainId][token.address] !== undefined) {
if (tokenMap[token.chainId][token.address] !== undefined) throw Error('Duplicate tokens.') console.error(new Error(`Duplicate token! ${token.address}`))
return tokenMap
}
return { return {
...tokenMap, ...tokenMap,
[token.chainId]: { [token.chainId]: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment