Commit 9e3c8029 authored by Iuri Matias's avatar Iuri Matias

refactor: remove unnecessary level of depth from runInNode

parent 9937c9c4
......@@ -126,22 +126,17 @@ TxRunner.prototype.runInVm = function (from, to, data, value, gasLimit, useCall,
TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCall, callback) {
const self = this
var tx = {
from: from,
to: to,
data: data,
value: value
}
var tx = { from: from, to: to, data: data, value: value }
if (useCall) {
tx.gas = gasLimit
executionContext.web3().eth.call(tx, function (error, result) {
return executionContext.web3().eth.call(tx, function (error, result) {
callback(error, {
result: result,
transactionHash: result.transactionHash
})
})
} else {
}
executionContext.web3().eth.estimateGas(tx, function (err, gasEstimation) {
if (err) {
return callback(err, gasEstimation)
......@@ -192,7 +187,6 @@ TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCal
executeTx(tx, null, self._api, callback)
}
})
}
}
function tryTillResponse (txhash, done) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment