Allow empty input arrays for ABIs (#3001)

This commit is contained in:
Jaco Greeff 2016-10-31 14:59:02 +01:00 committed by Gav Wood
parent ea784d7419
commit 10fcf7f051

View File

@ -74,7 +74,7 @@ export default class DetailsStep extends Component {
.filter((func) => !func.constant) .filter((func) => !func.constant)
.sort((a, b) => a.name.localeCompare(b.name)) .sort((a, b) => a.name.localeCompare(b.name))
.map((func) => { .map((func) => {
const params = func.abi.inputs const params = (func.abi.inputs || [])
.map((input, index) => { .map((input, index) => {
return ( return (
<span key={ input.name }> <span key={ input.name }>
@ -97,7 +97,7 @@ export default class DetailsStep extends Component {
<MenuItem <MenuItem
key={ func.signature } key={ func.signature }
value={ func.signature } value={ func.signature }
label={ func.name }> label={ func.name || '()' }>
{ name } { name }
</MenuItem> </MenuItem>
); );
@ -122,7 +122,7 @@ export default class DetailsStep extends Component {
return null; return null;
} }
return func.abi.inputs.map((input, index) => { return (func.abi.inputs || []).map((input, index) => {
const onChange = (event, value) => onValueChange(event, index, value); const onChange = (event, value) => onValueChange(event, index, value);
const onSubmit = (value) => onValueChange(null, index, value); const onSubmit = (value) => onValueChange(null, index, value);
const label = `${input.name}: ${input.type}`; const label = `${input.name}: ${input.type}`;