From d87311fbd2c447cda79bf24b009f930514fe4aad Mon Sep 17 00:00:00 2001 From: Jagoda Berry Rybacka Date: Tue, 1 Aug 2023 18:47:42 +0200 Subject: [PATCH] Remove failing yearn tokenlist --- background/services/preferences/db.ts | 14 ++++++++++++++ background/services/preferences/defaults.ts | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/background/services/preferences/db.ts b/background/services/preferences/db.ts index ea6bd20bbf..d8cd9ae60a 100644 --- a/background/services/preferences/db.ts +++ b/background/services/preferences/db.ts @@ -403,6 +403,20 @@ export class PreferenceDatabase extends Dexie { }) }) + // Remove broken yearn's token list + this.version(20).upgrade((tx) => { + return tx + .table("preferences") + .toCollection() + .modify((storedPreferences: Preferences) => { + const urls = storedPreferences.tokenLists.urls.filter( + (url) => !url.includes("meta.yearn.finance") + ) + + Object.assign(storedPreferences.tokenLists, { urls }) + }) + }) + // This is the old version for populate // https://dexie.org/docs/Dexie/Dexie.on.populate-(old-version) // The this does not behave according the new docs, but works diff --git a/background/services/preferences/defaults.ts b/background/services/preferences/defaults.ts index a1876c9255..41ce136b11 100644 --- a/background/services/preferences/defaults.ts +++ b/background/services/preferences/defaults.ts @@ -12,7 +12,6 @@ const defaultPreferences: Preferences = { "ipfs://bafybeihufwj43zej34itf66qyguq35k4f6s4ual4uk3iy643wn3xnff2ka" ).href, // the Taho community-curated list "https://gateway.ipfs.io/ipns/tokens.uniswap.org", // the Uniswap default list - "https://meta.yearn.finance/api/tokens/list", // the Yearn list "https://messari.io/tokenlist/messari-verified", // Messari-verified projects "https://wrapped.tokensoft.eth.limo", // Wrapped tokens "https://tokenlist.aave.eth.limo", // Aave-listed tokens and interest-bearing assets