forked from cerc-io/plugeth
gulp
This commit is contained in:
parent
03faec9d41
commit
1860b3dff9
34
dist/ethereum.js
vendored
34
dist/ethereum.js
vendored
@ -510,7 +510,7 @@ var utils = require('./utils');
|
|||||||
/// @returns array of (not?) indexed params
|
/// @returns array of (not?) indexed params
|
||||||
var filterInputs = function (inputs, indexed) {
|
var filterInputs = function (inputs, indexed) {
|
||||||
return inputs.filter(function (current) {
|
return inputs.filter(function (current) {
|
||||||
return inputs.indexed === indexed;
|
return current.indexed === indexed;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -556,10 +556,40 @@ var inputParser = function (address, signature, event) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var getArgumentsObject = function (inputs, indexed, notIndexed) {
|
||||||
|
var indexedCopy = indexed.slice();
|
||||||
|
var notIndexedCopy = notIndexed.slice();
|
||||||
|
return inputs.reduce(function (acc, current) {
|
||||||
|
var value;
|
||||||
|
if (current.indexed)
|
||||||
|
value = indexed.splice(0, 1)[0];
|
||||||
|
else
|
||||||
|
value = notIndexed.splice(0, 1)[0];
|
||||||
|
|
||||||
|
acc[current.name] = value;
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
var outputParser = function (event) {
|
var outputParser = function (event) {
|
||||||
|
|
||||||
return function (output) {
|
return function (output) {
|
||||||
|
var result = {
|
||||||
|
event: utils.extractDisplayName(event.name),
|
||||||
|
number: output.number
|
||||||
|
};
|
||||||
|
|
||||||
|
var indexedOutputs = filterInputs(event.inputs, true);
|
||||||
|
var indexedData = "0x" + output.topic.slice(1, output.topic.length).map(function (topic) { return topic.slice(2); }).join("");
|
||||||
|
var indexedRes = abi.formatOutput(indexedOutputs, indexedData);
|
||||||
|
|
||||||
|
var notIndexedOutputs = filterInputs(event.inputs, false);
|
||||||
|
var notIndexedRes = abi.formatOutput(notIndexedOutputs, output.data);
|
||||||
|
|
||||||
|
result.args = getArgumentsObject(event.inputs, indexedRes, notIndexedRes);
|
||||||
|
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
dist/ethereum.js.map
vendored
4
dist/ethereum.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/ethereum.min.js
vendored
2
dist/ethereum.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user