Fix event params decoding when no names for parameters #5409 (#5567)

This commit is contained in:
Nicolas Gotchac
2017-05-09 12:56:08 +02:00
committed by Jaco Greeff
parent 1288b4b28f
commit c5116e5049
3 changed files with 12 additions and 6 deletions

View File

@@ -99,15 +99,15 @@ export default class Event {
const namedTokens = {};
topicParams.forEach((param, idx) => {
namedTokens[param.name] = topicTokens[idx];
namedTokens[param.name || idx] = topicTokens[idx];
});
dataParams.forEach((param, idx) => {
namedTokens[param.name] = dataTokens[idx];
namedTokens[param.name || idx] = dataTokens[idx];
});
const inputParamTypes = this.inputParamTypes();
const decodedParams = this.inputParamNames()
.map((name, idx) => new DecodedLogParam(name, inputParamTypes[idx], namedTokens[name]));
.map((name, idx) => new DecodedLogParam(name, inputParamTypes[idx], namedTokens[name || idx]));
return new DecodedLog(decodedParams, address);
}