parent
1288b4b28f
commit
c5116e5049
@ -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);
|
||||
}
|
||||
|
@ -182,10 +182,11 @@ export default class Contract {
|
||||
log.params = {};
|
||||
log.event = event.name;
|
||||
|
||||
decoded.params.forEach((param) => {
|
||||
decoded.params.forEach((param, index) => {
|
||||
const { type, value } = param.token;
|
||||
const key = param.name || index;
|
||||
|
||||
log.params[param.name] = { type, value };
|
||||
log.params[key] = { type, value };
|
||||
});
|
||||
|
||||
return log;
|
||||
|
@ -112,11 +112,16 @@ export default class Event extends Component {
|
||||
}
|
||||
|
||||
renderParam (name, param) {
|
||||
// Don't add a label id the name is an index key (ie. a Number)
|
||||
const label = parseInt(name).toString() === name.toString()
|
||||
? undefined
|
||||
: name;
|
||||
|
||||
return (
|
||||
<TypedInput
|
||||
allowCopy
|
||||
className={ styles.input }
|
||||
label={ name }
|
||||
label={ label }
|
||||
param={ param.type }
|
||||
readOnly
|
||||
value={ param.value }
|
||||
|
Loading…
Reference in New Issue
Block a user