diff options
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) { |