diff --git a/src/app/execution/txRunner.js b/src/app/execution/txRunner.js index 9812fe1b39..889c789dab 100644 --- a/src/app/execution/txRunner.js +++ b/src/app/execution/txRunner.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 { diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index c5215a0362..772cbfde42 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -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`${values}`) }