error if account index is not found

This commit is contained in:
Iuri Matias 2018-01-19 20:38:28 -05:00
parent f2ae58e754
commit f35718b6c0
2 changed files with 4 additions and 0 deletions

View File

@ -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.');

View File

@ -21,6 +21,7 @@
"deploy": false
},
"SimpleStorage": {
"fromIndex": 1,
"args": [
100
]