From 977a138b1fc101469f9c1f9dadaab9e05da019c1 Mon Sep 17 00:00:00 2001 From: Ismail Khoffi Date: Sat, 1 Dec 2018 12:08:57 +0100 Subject: [PATCH] Review comments: wrap errors --- cmd/tendermint/commands/init.go | 3 ++- cmd/tendermint/commands/testnet.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/tendermint/commands/init.go b/cmd/tendermint/commands/init.go index 4c62d6518..c02725717 100644 --- a/cmd/tendermint/commands/init.go +++ b/cmd/tendermint/commands/init.go @@ -3,6 +3,7 @@ package commands import ( "fmt" + "github.com/pkg/errors" "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" @@ -59,7 +60,7 @@ func initFilesWithConfig(config *cfg.Config) error { } key, err := pv.GetPubKey() if err != nil { - return err + return errors.Wrap(err, "failed to get pubkey from private validator") } genDoc.Validators = []types.GenesisValidator{{ Address: key.Address(), diff --git a/cmd/tendermint/commands/testnet.go b/cmd/tendermint/commands/testnet.go index e5fce778f..c39ebf796 100644 --- a/cmd/tendermint/commands/testnet.go +++ b/cmd/tendermint/commands/testnet.go @@ -7,6 +7,7 @@ import ( "path/filepath" "strings" + "github.com/pkg/errors" "github.com/spf13/cobra" cfg "github.com/tendermint/tendermint/config" @@ -92,7 +93,7 @@ func testnetFiles(cmd *cobra.Command, args []string) error { pv := privval.LoadFilePV(pvFile) pubKey, err := pv.GetPubKey() if err != nil { - return err + return errors.Wrap(err, "failed to get pubkey from private validator") } genVals[i] = types.GenesisValidator{ Address: pubKey.Address(),