Merge pull request #792 from ethereum/debugVMcall

Minor changes
pull/1/head
yann300 7 years ago committed by GitHub
commit 03b292537c
  1. 7
      src/app/execution/txRunner.js
  2. 5
      src/app/panels/terminal.js

@ -56,12 +56,15 @@ TxRunner.prototype.execute = function (args, callback) {
var blockGasLimit = executionContext.currentblockGasLimit()
// NOTE: estimateGas very likely will return a large limit if execution of the code failed
// we want to be able to run the code in order to debug and find the cause for the failure
var warnEstimation = ' An important gas estimation might also be the sign of a problem in the contract code. Please check loops and be sure you did not sent value to a non payable function (that\'s also the reason of strong gas estimation).'
if (gasEstimation > gasLimit) {
return callback('Gas required exceeds limit: ' + gasLimit)
return callback('Gas required exceeds limit: ' + gasLimit + '. ' + warnEstimation)
}
if (gasEstimation > blockGasLimit) {
return callback('Gas required exceeds block gas limit: ' + gasLimit)
return callback('Gas required exceeds block gas limit: ' + gasLimit + '. ' + warnEstimation)
}
tx.gas = gasEstimation
var sendTransaction = self.personalMode ? executionContext.web3().personal.sendTransaction : executionContext.web3().eth.sendTransaction
try {

@ -508,7 +508,6 @@ class Terminal {
}, 0)
}
_blocksRenderer (mode) {
var self = this
mode = { log: 'black', info: 'blue', error: 'red' }[mode] // defaults
if (mode) {
return function logger (args, scopedCommands, append) {
@ -516,9 +515,7 @@ class Terminal {
var values = javascriptserialize.apply(null, args).map(function (val, idx) {
if (typeof args[idx] === 'string') val = args[idx]
if (types[idx] === 'element') val = jsbeautify.html(val)
var pattern = '.{1,' + self.data.lineLength + '}'
var lines = val.match(new RegExp(pattern, 'g'))
return lines.map(str => document.createTextNode(`${str}\n`))
return val
})
append(yo`<span style="color: ${mode};">${values}</span>`)
}

Loading…
Cancel
Save