parent
1288b4b28f
commit
c5116e5049
@ -99,15 +99,15 @@ export default class Event {
|
|||||||
const namedTokens = {};
|
const namedTokens = {};
|
||||||
|
|
||||||
topicParams.forEach((param, idx) => {
|
topicParams.forEach((param, idx) => {
|
||||||
namedTokens[param.name] = topicTokens[idx];
|
namedTokens[param.name || idx] = topicTokens[idx];
|
||||||
});
|
});
|
||||||
dataParams.forEach((param, idx) => {
|
dataParams.forEach((param, idx) => {
|
||||||
namedTokens[param.name] = dataTokens[idx];
|
namedTokens[param.name || idx] = dataTokens[idx];
|
||||||
});
|
});
|
||||||
|
|
||||||
const inputParamTypes = this.inputParamTypes();
|
const inputParamTypes = this.inputParamTypes();
|
||||||
const decodedParams = this.inputParamNames()
|
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);
|
return new DecodedLog(decodedParams, address);
|
||||||
}
|
}
|
||||||
|
@ -182,10 +182,11 @@ export default class Contract {
|
|||||||
log.params = {};
|
log.params = {};
|
||||||
log.event = event.name;
|
log.event = event.name;
|
||||||
|
|
||||||
decoded.params.forEach((param) => {
|
decoded.params.forEach((param, index) => {
|
||||||
const { type, value } = param.token;
|
const { type, value } = param.token;
|
||||||
|
const key = param.name || index;
|
||||||
|
|
||||||
log.params[param.name] = { type, value };
|
log.params[key] = { type, value };
|
||||||
});
|
});
|
||||||
|
|
||||||
return log;
|
return log;
|
||||||
|
@ -112,11 +112,16 @@ export default class Event extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
renderParam (name, param) {
|
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 (
|
return (
|
||||||
<TypedInput
|
<TypedInput
|
||||||
allowCopy
|
allowCopy
|
||||||
className={ styles.input }
|
className={ styles.input }
|
||||||
label={ name }
|
label={ label }
|
||||||
param={ param.type }
|
param={ param.type }
|
||||||
readOnly
|
readOnly
|
||||||
value={ param.value }
|
value={ param.value }
|
||||||
|
Loading…
Reference in New Issue
Block a user