abi.js cleanup && new types.js, utils.js
This commit is contained in:
25
lib/event.js
25
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) {
|
||||
|
Reference in New Issue
Block a user