Commit 4dad408e authored by yann300's avatar yann300

fix event decoder return value

parent e3c7adb8
...@@ -18,9 +18,9 @@ class EventsDecoder { ...@@ -18,9 +18,9 @@ class EventsDecoder {
* @param {Function} cb - callback * @param {Function} cb - callback
*/ */
parseLogs (tx, contractName, compiledContracts, cb) { parseLogs (tx, contractName, compiledContracts, cb) {
if (tx.isCall) return cb(null, []) if (tx.isCall) return cb(null, { decoded: [], raw: [] })
this._api.resolveReceipt(tx, (error, receipt) => { this._api.resolveReceipt(tx, (error, receipt) => {
if (error) cb(error) if (error) return cb(error)
this._decodeLogs(tx, receipt, contractName, compiledContracts, cb) this._decodeLogs(tx, receipt, contractName, compiledContracts, cb)
}) })
} }
...@@ -30,7 +30,7 @@ class EventsDecoder { ...@@ -30,7 +30,7 @@ class EventsDecoder {
return cb('cannot decode logs - contract or receipt not resolved ') return cb('cannot decode logs - contract or receipt not resolved ')
} }
if (!receipt.logs) { if (!receipt.logs) {
return cb(null, []) return cb(null, { decoded: [], raw: [] })
} }
this._decodeEvents(tx, receipt.logs, contract, contracts, cb) this._decodeEvents(tx, receipt.logs, contract, contracts, 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