From 25d0fb593cdf431f19678fd91c74a4d071162438 Mon Sep 17 00:00:00 2001 From: Christopher Goes Date: Wed, 11 Apr 2018 17:47:56 +0200 Subject: [PATCH] Address PR comments --- client/context/viper.go | 10 +--------- client/core/context.go | 2 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/client/context/viper.go b/client/context/viper.go index 193fe9baa..c3b0369d9 100644 --- a/client/context/viper.go +++ b/client/context/viper.go @@ -1,10 +1,8 @@ package context import ( - "encoding/json" "fmt" "github.com/spf13/viper" - "io/ioutil" tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" rpcclient "github.com/tendermint/tendermint/rpc/client" @@ -48,13 +46,7 @@ func defaultChainID() (string, error) { if err != nil { return "", err } - genesisFile := cfg.GenesisFile() - bz, err := ioutil.ReadFile(genesisFile) - if err != nil { - return "", err - } - var doc tmtypes.GenesisDoc - err = json.Unmarshal(bz, &doc) + doc, err := tmtypes.GenesisDocFromFile(cfg.GenesisFile()) if err != nil { return "", err } diff --git a/client/core/context.go b/client/core/context.go index 7f8d76432..fac60b553 100644 --- a/client/core/context.go +++ b/client/core/context.go @@ -24,7 +24,7 @@ func (c CoreContext) WithChainID(chainID string) CoreContext { return c } -// WithHeight - eturn a copy of the context with an updated height +// WithHeight - return a copy of the context with an updated height func (c CoreContext) WithHeight(height int64) CoreContext { c.Height = height return c