Commit d27f2e6c authored by Iuri Matias's avatar Iuri Matias

extract address from transaction result in transactionExecuted event

parent 15e356c4
......@@ -67,11 +67,10 @@ class Recorder {
}
})
this.blockchain.event.register('transactionExecuted', (error, from, to, data, call, txResult, timestamp) => {
this.blockchain.event.register('transactionExecuted', (error, from, to, data, call, txResult, timestamp, _payload, rawAddress) => {
if (error) return console.log(error)
if (call) return
const rawAddress = this.blockchain.getAddressFromTransactionResult(txResult)
if (!rawAddress) return // not a contract creation
const stringAddress = this.addressToString(rawAddress)
const address = ethutil.toChecksumAddress(stringAddress)
......
......@@ -426,8 +426,10 @@ class Blockchain {
self.event.trigger('initiatingTransaction', [timestamp, tx, payLoad])
self.txRunner.rawRun(tx, confirmationCb, continueCb, promptCb,
function (error, result) {
const rawAddress = self.getAddressFromTransactionResult(result)
let eventName = (tx.useCall ? 'callExecuted' : 'transactionExecuted')
self.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad])
self.event.trigger(eventName, [error, tx.from, tx.to, tx.data, tx.useCall, result, timestamp, payLoad, rawAddress])
if (error && (typeof (error) !== 'string')) {
if (error.message) error = error.message
......
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