diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-31 09:54:17 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-31 09:54:17 +0800 |
commit | 2491c99b37241b8770bca516d5641b2d00a7a660 (patch) | |
tree | 956d33da28ff07b126282baafd9450d9710c3a86 /lib/event.js | |
parent | cf534d47262c335faf97ad0c057278103c33ae88 (diff) | |
download | dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar.gz dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar.bz2 dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar.lz dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar.xz dexon-2491c99b37241b8770bca516d5641b2d00a7a660.tar.zst dexon-2491c99b37241b8770bca516d5641b2d00a7a660.zip |
abi.js cleanup && new types.js, utils.js
Diffstat (limited to 'lib/event.js')
-rw-r--r-- | lib/event.js | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/lib/event.js b/lib/event.js index ea5f5b71e..c01fea6ef 100644 --- a/lib/event.js +++ b/lib/event.js @@ -21,8 +21,31 @@ */ var abi = require('./abi'); +var utils = require('./utils'); + +var inputWithName = function (inputs, name) { + var index = utils.findIndex(inputs, function (input) { + return input.name === name; + }); + if (index === -1) { + console.error('indexed param ' + name + ' not found in the abi'); + return undefined; + } + return inputs[index]; +}; + +var indexedParamsToTopics = function (inputs, indexed) { + Object.keys(indexed).map(function (key) { + var inp = inputWithName(key); + var value = indexed[key]; + if (value instanceof Array) { + + } + }); +}; + +var implementationOfEvent = function (address, signature, event) { -var implementationOfEvent = function (address, signature) { // valid options are 'earliest', 'latest', 'offset' and 'max', as defined for 'eth.watch' return function (indexed, options) { |