diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index 8a5df9009..fb0c1c65f 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -191,6 +191,9 @@ class Deploy { // applying deployer account configuration, if any if (typeof contract.fromIndex == 'number') { deploymentAccount = accounts[contract.fromIndex]; + if (deploymentAccount === undefined) { + return next("error deploying " + contract.className + ": no account found at index " + contract.fromIndex + " check the config"); + } } if (typeof contract.from == 'string' && typeof contract.fromIndex != 'undefined') { self.logger.warn('Both "from" and "fromIndex" are defined for contract "'+contract.className+'". Using "from" as deployer account.'); diff --git a/test_app/config/contracts.json b/test_app/config/contracts.json index 814703184..f1e342e1a 100644 --- a/test_app/config/contracts.json +++ b/test_app/config/contracts.json @@ -21,6 +21,7 @@ "deploy": false }, "SimpleStorage": { + "fromIndex": 1, "args": [ 100 ]