abi.js cleanup && new types.js, utils.js

This commit is contained in:
Marek Kotewicz
2015-01-31 02:54:17 +01:00
parent cf534d4726
commit 2491c99b37
9 changed files with 327 additions and 169 deletions

View File

@ -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) {