From 66357a221003b34f9b91b91d0279a79b3aa90cee Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 9 Aug 2017 16:39:29 +0200 Subject: [PATCH] add transactionExecuted event --- src/app/execution/txListener.js | 2 +- src/universal-dapp.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/execution/txListener.js b/src/app/execution/txListener.js index 8388ae7c61..fc2136530a 100644 --- a/src/app/execution/txListener.js +++ b/src/app/execution/txListener.js @@ -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) diff --git a/src/universal-dapp.js b/src/universal-dapp.js index bebaa205ad..908435a1c2 100644 --- a/src/universal-dapp.js +++ b/src/universal-dapp.js @@ -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) }