|
|
@ -186,18 +186,18 @@ function ExecutionContext () { |
|
|
|
|
|
|
|
|
|
|
|
this.blockGasLimitDefault = 4300000 |
|
|
|
this.blockGasLimitDefault = 4300000 |
|
|
|
this.blockGasLimit = this.blockGasLimitDefault |
|
|
|
this.blockGasLimit = this.blockGasLimitDefault |
|
|
|
setInterval(() => { |
|
|
|
// removing the setinterval cause it cause tape test to hang and we don't need this.
|
|
|
|
if (this.getProvider() !== 'vm') { |
|
|
|
// there's a copy of this file in remix-ide repo @TODO to refactor
|
|
|
|
web3.eth.getBlock('latest', (err, block) => { |
|
|
|
if (this.getProvider() !== 'vm') { |
|
|
|
if (!err) { |
|
|
|
web3.eth.getBlock('latest', (err, block) => { |
|
|
|
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506
|
|
|
|
if (!err) { |
|
|
|
this.blockGasLimit = (block && block.gasLimit) ? Math.floor(block.gasLimit - (5 * block.gasLimit) / 1024) : this.blockGasLimitDefault |
|
|
|
// we can't use the blockGasLimit cause the next blocks could have a lower limit : https://github.com/ethereum/remix/issues/506
|
|
|
|
} else { |
|
|
|
this.blockGasLimit = (block && block.gasLimit) ? Math.floor(block.gasLimit - (5 * block.gasLimit) / 1024) : this.blockGasLimitDefault |
|
|
|
this.blockGasLimit = this.blockGasLimitDefault |
|
|
|
} else { |
|
|
|
} |
|
|
|
this.blockGasLimit = this.blockGasLimitDefault |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 15000) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// TODO: not used here anymore and needs to be moved
|
|
|
|
// TODO: not used here anymore and needs to be moved
|
|
|
|
function setProviderFromEndpoint (endpoint, context, cb) { |
|
|
|
function setProviderFromEndpoint (endpoint, context, cb) { |
|
|
|