diff --git a/apps/remix-ide/src/app/udapp/run-tab.js b/apps/remix-ide/src/app/udapp/run-tab.js index d4214c444f..a96db8a3a8 100644 --- a/apps/remix-ide/src/app/udapp/run-tab.js +++ b/apps/remix-ide/src/app/udapp/run-tab.js @@ -113,7 +113,10 @@ export class RunTab extends ViewPlugin { title, init: async function () { const options = await udapp.call(name, 'init') - if (options) { this.options = options } + if (options) { + this.options = options + if (options['fork']) this.fork = options['fork'] + } }, provider: { async sendAsync (payload, callback) { diff --git a/apps/remix-ide/src/blockchain/execution-context.js b/apps/remix-ide/src/blockchain/execution-context.js index e632045d52..692396265d 100644 --- a/apps/remix-ide/src/blockchain/execution-context.js +++ b/apps/remix-ide/src/blockchain/execution-context.js @@ -131,10 +131,10 @@ export class ExecutionContext { if (!confirmCb) confirmCb = () => { /* Do nothing. */ } if (!infoCb) infoCb = () => { /* Do nothing. */ } if (this.customNetWorks[context]) { - var network = this.customNetWorks[context] + var network = this.customNetWorks[context] + await network.init() this.currentFork = network.fork this.executionContext = context - await network.init() // injected web3.setProvider(network.provider) await this._updateChainContext()