From e908298d26e68041859d1d0bde1162419ee821a8 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 21 Sep 2017 17:53:05 +0200 Subject: [PATCH] readd ethJSABI.stringify --- src/app/execution/eventsDecoder.js | 4 +++- src/app/execution/txFormat.js | 1 + src/app/execution/txListener.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app/execution/eventsDecoder.js b/src/app/execution/eventsDecoder.js index 6e72630dfe..c9222dd9f7 100644 --- a/src/app/execution/eventsDecoder.js +++ b/src/app/execution/eventsDecoder.js @@ -85,6 +85,7 @@ class EventsDecoder { var encodedData = log.topics[indexed].replace('0x', '') try { decoded[index] = ethJSABI.rawDecode([item.type], new Buffer(encodedData, 'hex'))[0] + decoded[index] = ethJSABI.stringify([item.type], decoded[index]) } catch (e) { decoded[index] = encodedData } @@ -94,7 +95,8 @@ class EventsDecoder { } }) // decode non indexed param - nonindexed = ethJSABI.rawDecode(nonindexed, new Buffer(log.data.replace('0x', ''), 'hex')) + var nonindexededResult = ethJSABI.rawDecode(nonindexed, new Buffer(log.data.replace('0x', ''), 'hex')) + nonindexed = ethJSABI.stringify(nonindexed, nonindexededResult) // ordering var j = 0 abi.inputs.map(function (item, index) { diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index 5faea74eeb..14e0412f57 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -155,6 +155,7 @@ module.exports = { var decodedObj = ethJSABI.rawDecode(outputTypes, response) // format decoded data + decodedObj = ethJSABI.stringify(outputTypes, decodedObj) var json = {} for (i = 0; i < outputTypes.length; i++) { var name = fnabi.outputs[i].name diff --git a/src/app/execution/txListener.js b/src/app/execution/txListener.js index 93b5504f14..8c07f910ba 100644 --- a/src/app/execution/txListener.js +++ b/src/app/execution/txListener.js @@ -307,6 +307,7 @@ class TxListener { inputTypes.push(abi.inputs[i].type) } var decoded = ethJSABI.rawDecode(inputTypes, data) + decoded = ethJSABI.stringify(inputTypes, decoded) var ret = {} for (var k in abi.inputs) { ret[abi.inputs[k].type + ' ' + abi.inputs[k].name] = decoded[k]