Commit 3974f9aa authored by Alex Beregszaszi's avatar Alex Beregszaszi

Use getAccounts in runTx

parent 1b8a723d
...@@ -723,12 +723,21 @@ UniversalDApp.prototype.runTx = function (args, cb) { ...@@ -723,12 +723,21 @@ UniversalDApp.prototype.runTx = function (args, cb) {
// NOTE: getAddress should be async // NOTE: getAddress should be async
if (self.getAddress) { if (self.getAddress) {
tx.from = self.getAddress() tx.from = self.getAddress()
} else if (self.executionContext.isVM()) { callback()
tx.from = Object.keys(self.accounts)[0]
} else { } else {
tx.from = self.web3.eth.accounts[0] self.getAccounts(function (err, ret) {
if (err) {
return callback(err)
}
if (ret.length === 0) {
return callback('No accounts available')
}
tx.from = ret[0]
callback()
})
} }
callback()
}, },
// run transaction // run transaction
function (callback) { function (callback) {
......
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