Commit 66357a22 authored by yann300's avatar yann300

add transactionExecuted event

parent b53895e8
......@@ -25,7 +25,7 @@ class TxListener {
this.startListening(context)
}
})
opt.event.udapp.register('transactionExecuted', (to, data, lookupOnly, txResult) => {
opt.event.udapp.register('transactionExecuted', (to, data, txResult) => {
if (this.loopId && this._api.isVM()) {
this._api.web3().eth.getTransaction(txResult.transactionHash, (error, tx) => {
if (error) return console.log(error)
......
......@@ -473,7 +473,12 @@ UniversalDApp.prototype.runTx = function (args, cb) {
},
// run transaction
function (callback) {
self.txRunner.rawRun(tx, function (error, result) { callback(error, result) })
self.txRunner.rawRun(tx, function (error, result) {
if (!args.useCall) {
self.event.trigger('transactionExecuted', [args.to, args.data, result])
}
callback(error, result)
})
}
], cb)
}
......
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