Better error message on incompatible validator data when resetting a testnet

This commit is contained in:
Zahary Karadjov 2019-06-19 16:41:54 +03:00
parent e228c2dbcb
commit 25494aa2fb
No known key found for this signature in database
GPG Key ID: C8936F8A3073D609
1 changed files with 7 additions and 1 deletions

View File

@ -722,7 +722,13 @@ when isMainModule:
for i in config.firstValidator.int ..< config.totalValidators.int:
let depositFile = config.validatorsDir /
validatorFileBaseName(i) & ".deposit.json"
try:
deposits.add Json.loadFile(depositFile, Deposit)
except SerializationError as err:
stderr.write "Error while loading a deposit file:\n"
stderr.write err.formatMsg(depositFile), "\n"
stderr.write "Please regenerate the deposit files by running validator_keygen again\n"
quit 1
let initialState = get_genesis_beacon_state(
deposits,