@@ -134,8 +135,6 @@ export class ExecutionContext {
...
@@ -134,8 +135,6 @@ export class ExecutionContext {
returncb()
returncb()
}
}
this.currentFork=' - '
if(context==='injected'){
if(context==='injected'){
if(injectedProvider===undefined){
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).')
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 {
...
@@ -144,7 +143,7 @@ export class ExecutionContext {
this.askPermission()
this.askPermission()
this.executionContext=context
this.executionContext=context
web3.setProvider(injectedProvider)
web3.setProvider(injectedProvider)
this._updateBlockGasLimit()
this._updateChainContext()
this.event.trigger('contextChanged',['injected'])
this.event.trigger('contextChanged',['injected'])
returncb()
returncb()
}
}
...
@@ -171,12 +170,19 @@ export class ExecutionContext {
...
@@ -171,12 +170,19 @@ export class ExecutionContext {
this.listenOnLastBlockId=null
this.listenOnLastBlockId=null
}
}
_updateBlockGasLimit(){
_updateChainContext(){
if(this.getProvider()!=='vm'){
if(this.getProvider()!=='vm'){
web3.eth.getBlock('latest',(err,block)=>{
web3.eth.getBlock('latest',async(err,block)=>{
if(!err){
if(!err){
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506