From d7c9a5948d0ee55674841a2ea54fc1cefa12ddb8 Mon Sep 17 00:00:00 2001 From: Rongjian Lan Date: Tue, 11 Jun 2019 22:38:57 -0700 Subject: [PATCH] have better error message for bls key init --- cmd/harmony/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 1189a8ae8..0b984f22d 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -242,7 +242,7 @@ func createGlobalConfig() *nodeconfig.ConfigType { if *isGenesis { err := consensusPriKey.DeserializeHexStr(genesisAccount.BlsPriKey) if err != nil { - panic(fmt.Errorf("generate key error")) + panic(fmt.Errorf("Failed to parse BLS private key: %s", genesisAccount.BlsPriKey)) } } else { // NewNode won't work @@ -263,7 +263,7 @@ func createGlobalConfig() *nodeconfig.ConfigType { // Consensus keys are the BLS12-381 keys used to sign consensus messages nodeConfig.ConsensusPriKey, nodeConfig.ConsensusPubKey = consensusPriKey, consensusPriKey.GetPublicKey() if nodeConfig.ConsensusPriKey == nil || nodeConfig.ConsensusPubKey == nil { - panic(fmt.Errorf("generate key error")) + panic(fmt.Errorf("Failed to initialize BLS keys: %s", consensusPriKey)) } // Key Setup ================= [End]