fix getting the current fork

pull/5370/head
yann300 2 years ago committed by Aniket
parent 284bfc8a00
commit 4ade58a3d4
  1. 5
      apps/remix-ide/src/app/udapp/run-tab.js
  2. 4
      apps/remix-ide/src/blockchain/execution-context.js

@ -113,7 +113,10 @@ export class RunTab extends ViewPlugin {
title, title,
init: async function () { init: async function () {
const options = await udapp.call(name, 'init') 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: { provider: {
async sendAsync (payload, callback) { async sendAsync (payload, callback) {

@ -131,10 +131,10 @@ export class ExecutionContext {
if (!confirmCb) confirmCb = () => { /* Do nothing. */ } if (!confirmCb) confirmCb = () => { /* Do nothing. */ }
if (!infoCb) infoCb = () => { /* Do nothing. */ } if (!infoCb) infoCb = () => { /* Do nothing. */ }
if (this.customNetWorks[context]) { if (this.customNetWorks[context]) {
var network = this.customNetWorks[context] var network = this.customNetWorks[context]
await network.init()
this.currentFork = network.fork this.currentFork = network.fork
this.executionContext = context this.executionContext = context
await network.init()
// injected // injected
web3.setProvider(network.provider) web3.setProvider(network.provider)
await this._updateChainContext() await this._updateChainContext()

Loading…
Cancel
Save