From be2c2e27f39996a8a29b42951cba1ca9ce069fb9 Mon Sep 17 00:00:00 2001 From: Zahary Karadjov Date: Sun, 2 Aug 2020 21:47:15 +0300 Subject: [PATCH] Cosmetic fixes --- beacon_chain/beacon_node.nim | 2 +- beacon_chain/keystore_management.nim | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/beacon_chain/beacon_node.nim b/beacon_chain/beacon_node.nim index f745d5afd..518b0d793 100644 --- a/beacon_chain/beacon_node.nim +++ b/beacon_chain/beacon_node.nim @@ -1238,7 +1238,7 @@ programMain: let depositDataPath = if config.outDepositsFile.isSome: config.outDepositsFile.get.string else: - config.outValidatorsDir / "deposit_data-" & $epochTime() + config.outValidatorsDir / "deposit_data-" & $epochTime() & ".json" let launchPadDeposits = mapIt(deposits.value, LaunchPadDeposit.init(config.runtimePreset, it)) diff --git a/beacon_chain/keystore_management.nim b/beacon_chain/keystore_management.nim index 0f3640b74..ff32a225f 100644 --- a/beacon_chain/keystore_management.nim +++ b/beacon_chain/keystore_management.nim @@ -95,7 +95,8 @@ iterator validatorKeys*(conf: BeaconNodeConf|ValidatorClientConf): ValidatorPriv type KeystoreGenerationError = enum RandomSourceDepleted, - FailedToCreateValidatoDir + FailedToCreateValidatorDir + FailedToCreateSecretsDir FailedToCreateSecretFile FailedToCreateKeystoreFile @@ -117,7 +118,10 @@ proc saveKeystore(rng: var BrHmacDrbgContext, keystoreFile = validatorDir / keystoreFileName try: createDir validatorDir - except OSError, IOError: return err FailedToCreateValidatoDir + except OSError, IOError: return err FailedToCreateValidatorDir + + try: createDir secretsDir + except OSError, IOError: return err FailedToCreateSecretsDir try: writeFile(secretsDir / keyName, password.string) except IOError: return err FailedToCreateSecretFile @@ -238,8 +242,9 @@ proc importKeystoresFromDir*(rng: var BrHmacDrbgContext, if secret.len == 0: if firstDecryptionAttempt: try: - echo "Please enter the password for decrypting '$1' " & - "or press ENTER to skip importing this keystore" % [file] + const msg = "Please enter the password for decrypting '$1' " & + "or press ENTER to skip importing this keystore" + echo msg % [file] except ValueError: raiseAssert "The format string above is correct" else: