refactor: remove unnecessary level of depth from runInVm

pull/1/head
Iuri Matias 7 years ago
parent adfdea8b1b
commit 62ed083f9b
  1. 8
      src/app/execution/txRunner.js

@ -68,13 +68,16 @@ TxRunner.prototype.execute = function (args, callback) {
if (!executionContext.isVM()) {
self.runInNode(args.from, args.to, data, args.value, args.gasLimit, args.useCall, callback)
} else {
try {
self.runInVm(args.from, args.to, data, args.value, args.gasLimit, args.useCall, callback)
} catch (e) {
callback(e, null)
}
}
}
TxRunner.prototype.runInVm = function (from, to, data, value, gasLimit, useCall, callback) {
const self = this
try {
var account = self.vmaccounts[from]
if (!account) {
return callback('Invalid account selected')
@ -119,9 +122,6 @@ TxRunner.prototype.runInVm = function (from, to, data, value, gasLimit, useCall,
transactionHash: ethJSUtil.bufferToHex(new Buffer(tx.hash()))
})
})
} catch (e) {
callback(e, null)
}
}
TxRunner.prototype.runInNode = function (from, to, data, value, gasLimit, useCall, callback) {

Loading…
Cancel
Save