formatInput && formatOutput simplified
This commit is contained in:
10
lib/event.js
10
lib/event.js
@ -38,19 +38,15 @@ var inputWithName = function (inputs, name) {
|
||||
var indexedParamsToTopics = function (event, indexed) {
|
||||
// sort keys?
|
||||
return Object.keys(indexed).map(function (key) {
|
||||
// TODO: simplify this!
|
||||
var parser = abi.inputParser([{
|
||||
name: 'test',
|
||||
inputs: [inputWithName(event.inputs, key)]
|
||||
}]);
|
||||
var inputs = [inputWithName(event.inputs, key)];
|
||||
|
||||
var value = indexed[key];
|
||||
if (value instanceof Array) {
|
||||
return value.map(function (v) {
|
||||
return parser.test(v);
|
||||
return abi.formatInput(inputs, [v]);
|
||||
});
|
||||
}
|
||||
return parser.test(value);
|
||||
return abi.formatInput(inputs, [value]);
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user