add transactionExecuted event

pull/1/head
yann300 7 years ago
parent b53895e846
commit 66357a2210
  1. 2
      src/app/execution/txListener.js
  2. 7
      src/universal-dapp.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)

@ -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)
}

Loading…
Cancel
Save