aboutsummaryrefslogtreecommitdiffstats
path: root/lib/contract.js
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-02-03 23:16:38 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-02-03 23:16:38 +0800
commita5909d82eb16d6e631bd5f89d700eced205b2fcf (patch)
treee27c8a49992843496c6c48bbb94928c7d3c62b04 /lib/contract.js
parent1860b3dff93e3a09cb7fba753b8531b11169f915 (diff)
downloaddexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar.gz
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar.bz2
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar.lz
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar.xz
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.tar.zst
dexon-a5909d82eb16d6e631bd5f89d700eced205b2fcf.zip
parsing events output
Diffstat (limited to 'lib/contract.js')
-rw-r--r--lib/contract.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/contract.js b/lib/contract.js
index 82e59af54..a0525bd9d 100644
--- a/lib/contract.js
+++ b/lib/contract.js
@@ -120,6 +120,11 @@ var addFunctionsToContract = function (contract, desc, address) {
var addEventRelatedPropertiesToContract = function (contract, desc, address) {
contract.address = address;
+ contract._onWatchEventResult = function (data) {
+ var matchingEvent = event.getMatchingEvent(utils.filterEvents(desc));
+ var parser = eventImpl.outputParser(matchingEvent);
+ return parser(data);
+ };
Object.defineProperty(contract, 'topic', {
get: function() {
@@ -140,6 +145,10 @@ var addEventsToContract = function (contract, desc, address) {
var signature = abi.eventSignatureFromAscii(e.name);
var event = eventImpl.inputParser(address, signature, e);
var o = event.apply(null, params);
+ o._onWatchEventResult = function (data) {
+ var parser = eventImpl.outputParser(e);
+ return parser(data);
+ };
return web3.eth.watch(o);
};