Merge pull request #3518 from ethcore/ng-solc-combined-fix
ABI can be empty and auto-fill contract name
This commit is contained in:
commit
c9d1eb085c
@ -103,7 +103,7 @@ export default class DetailsStep extends Component {
|
||||
label='contract name'
|
||||
hint='a name for the deployed contract'
|
||||
error={ nameError }
|
||||
value={ name }
|
||||
value={ name || '' }
|
||||
onChange={ this.onNameChange } />
|
||||
|
||||
<Input
|
||||
@ -169,6 +169,10 @@ export default class DetailsStep extends Component {
|
||||
const contractName = Object.keys(contracts)[index];
|
||||
const contract = contracts[contractName];
|
||||
|
||||
if (!this.props.name || this.props.name.trim() === '') {
|
||||
this.onNameChange(null, contractName);
|
||||
}
|
||||
|
||||
const { abi, bin } = contract;
|
||||
const code = /^0x/.test(bin) ? bin : `0x${bin}`;
|
||||
|
||||
|
@ -37,7 +37,7 @@ export function validateAbi (abi, api) {
|
||||
try {
|
||||
abiParsed = JSON.parse(abi);
|
||||
|
||||
if (!api.util.isArray(abiParsed) || !abiParsed.length) {
|
||||
if (!api.util.isArray(abiParsed)) {
|
||||
abiError = ERRORS.invalidAbi;
|
||||
return { abi, abiError, abiParsed };
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user