From 65d668c3f68f90ff1c7e0add19f037637b549b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Wed, 4 Mar 2020 23:53:32 +0100 Subject: [PATCH] Update validator keygen --- beacon_chain/validator_keygen.nim | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/beacon_chain/validator_keygen.nim b/beacon_chain/validator_keygen.nim index 30e25bcc1..5158d9ea5 100644 --- a/beacon_chain/validator_keygen.nim +++ b/beacon_chain/validator_keygen.nim @@ -37,9 +37,14 @@ proc generateDeposits*(totalValidators: int, debug "Rewriting unreadable deposit", err = err.formatMsg(depositFn) discard - let - privKey = if randomKeys: ValidatorPrivKey.random - else: makeInteropPrivKey(i) + var + privkey{.noInit.}: ValidatorPrivKey + pubKey{.noInit.}: ValidatorPubKey + + if randomKeys: + (pubKey, privKey) = newKeyPair() + else: + privKey = makeInteropPrivKey(i) pubKey = privKey.pubKey() let dp = makeDeposit(pubKey, privKey)