diff --git a/client/context/viper.go b/client/context/viper.go index 193fe9baa6..c3b0369d98 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 7f8d764324..fac60b553b 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