@@ -134,8 +135,6 @@ export class ExecutionContext {
returncb()
}
this.currentFork=' - '
if(context==='injected'){
if(injectedProvider===undefined){
infoCb('No injected Web3 provider found. Make sure your provider (e.g. MetaMask) is active and running (when recently activated you may have to reload the page).')
...
...
@@ -144,7 +143,7 @@ export class ExecutionContext {
this.askPermission()
this.executionContext=context
web3.setProvider(injectedProvider)
this._updateBlockGasLimit()
this._updateChainContext()
this.event.trigger('contextChanged',['injected'])
returncb()
}
...
...
@@ -171,12 +170,19 @@ export class ExecutionContext {
this.listenOnLastBlockId=null
}
_updateBlockGasLimit(){
_updateChainContext(){
if(this.getProvider()!=='vm'){
web3.eth.getBlock('latest',(err,block)=>{
web3.eth.getBlock('latest',async(err,block)=>{
if(!err){
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506