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, ...@@ -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) { TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCall, callback) {
const self = this const self = this
var tx = { var tx = { from: from, to: to, data: data, value: value }
from: from,
to: to,
data: data,
value: value
}
if (useCall) { if (useCall) {
tx.gas = gasLimit tx.gas = gasLimit
executionContext.web3().eth.call(tx, function (error, result) { return executionContext.web3().eth.call(tx, function (error, result) {
callback(error, { callback(error, {
result: result, result: result,
transactionHash: result.transactionHash transactionHash: result.transactionHash
}) })
}) })
} else { }
executionContext.web3().eth.estimateGas(tx, function (err, gasEstimation) { executionContext.web3().eth.estimateGas(tx, function (err, gasEstimation) {
if (err) { if (err) {
return callback(err, gasEstimation) return callback(err, gasEstimation)
...@@ -192,7 +187,6 @@ TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCal ...@@ -192,7 +187,6 @@ TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCal
executeTx(tx, null, self._api, callback) executeTx(tx, null, self._api, callback)
} }
}) })
}
} }
function tryTillResponse (txhash, done) { 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