Commit 51f91881 authored by yann300's avatar yann300

fix transactionExecuted event

parent 24c4642a
...@@ -25,7 +25,8 @@ class TxListener { ...@@ -25,7 +25,8 @@ class TxListener {
this.startListening(context) this.startListening(context)
} }
}) })
opt.event.udapp.register('transactionExecuted', (to, data, txResult) => { opt.event.udapp.register('transactionExecuted', (error, to, data, lookupOnly, txResult) => {
if (error) return
if (this.loopId && this._api.isVM()) { if (this.loopId && this._api.isVM()) {
this._api.web3().eth.getTransaction(txResult.transactionHash, (error, tx) => { this._api.web3().eth.getTransaction(txResult.transactionHash, (error, tx) => {
if (error) return console.log(error) if (error) return console.log(error)
......
...@@ -371,7 +371,8 @@ function settings (appAPI, appEvents) { ...@@ -371,7 +371,8 @@ function settings (appAPI, appEvents) {
` `
// EVENTS // EVENTS
appEvents.udapp.register('transactionExecuted', (to, data, lookupOnly, txResult) => { appEvents.udapp.register('transactionExecuted', (error, to, data, lookupOnly, txResult) => {
if (error) return
if (!lookupOnly) el.querySelector('#value').value = '0' if (!lookupOnly) el.querySelector('#value').value = '0'
}) })
......
...@@ -479,7 +479,7 @@ UniversalDApp.prototype.runTx = function (args, cb) { ...@@ -479,7 +479,7 @@ UniversalDApp.prototype.runTx = function (args, cb) {
function (callback) { function (callback) {
self.txRunner.rawRun(tx, function (error, result) { self.txRunner.rawRun(tx, function (error, result) {
if (!args.useCall) { if (!args.useCall) {
self.event.trigger('transactionExecuted', [args.to, args.data, result]) self.event.trigger('transactionExecuted', [error, args.to, args.data, false, result])
} }
callback(error, result) callback(error, result)
}) })
......
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