diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index 6163ee766c..3a4a0f5145 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -127,6 +127,11 @@ export const DebuggerApiMixin = (Base) => class extends Base { } debug (hash, web3?) { + try { + this.call('fetchAndCompile', 'clearCache') + } catch (e) { + console.error(e) + } this.debugHash = hash if (web3) this._web3 = web3 else this._web3 = this.initialWeb3 diff --git a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts index bf8b87bf55..f8446886b7 100644 --- a/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts +++ b/libs/remix-core-plugin/src/lib/compiler-fetch-and-compile.ts @@ -8,7 +8,7 @@ import { fetchContractFromSourcify } from './helpers/fetch-sourcify' const profile = { name: 'fetchAndCompile', - methods: ['resolve'], + methods: ['resolve', 'clearCache'], version: '0.0.1' } @@ -21,6 +21,14 @@ export class FetchAndCompile extends Plugin { this.sourceVerifierNetWork = ['Main', 'Rinkeby', 'Ropsten', 'Goerli'] } + /** + * Clear the cache + * + */ + async clearCache () { + this.unresolvedAddresses = [] + } + /** * Fetch compiliation metadata from source-Verify from a given @arg contractAddress - https://github.com/ethereum/source-verify * Put the artifacts in the file explorer