don't set a current fork if injected or web3 is used

pull/5370/head
yann300 3 years ago committed by joseph izang
parent f501c199a5
commit ee6f759d82
  1. 8
      apps/remix-ide/src/blockchain/execution-context.js

@ -21,8 +21,7 @@ export class ExecutionContext {
this.executionContext = null
this.blockGasLimitDefault = 4300000
this.blockGasLimit = this.blockGasLimitDefault
this.defaultFork = 'berlin'
this.currentFork = this.defaultFork
this.currentFork = ' - '
this.mainNetGenesisHash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3'
this.customNetWorks = {}
this.blocks = {}
@ -125,18 +124,17 @@ export class ExecutionContext {
executionContextChange (value, endPointUrl, confirmCb, infoCb, cb) {
const context = value.context
const fork = value.fork || this.defaultFork
if (!cb) cb = () => {}
if (!confirmCb) confirmCb = () => {}
if (!infoCb) infoCb = () => {}
if (context === 'vm') {
this.executionContext = context
this.currentFork = fork
this.currentFork = value.fork
this.event.trigger('contextChanged', ['vm'])
return cb()
}
this.currentFork = this.defaultFork // in the case of injected and web3, we default to the last fork.
this.currentFork = ' - '
if (context === 'injected') {
if (injectedProvider === undefined) {

Loading…
Cancel
Save