Use correct Bech32 prefix for show-address command (#2746)

* Use consensus address bech32 prefix
* Update show-address CLI description
This commit is contained in:
Alexander Bezobchuk
2018-11-11 23:34:50 -08:00
committed by Jae Kwon
parent bb54a0de12
commit 811b863677
2 changed files with 5 additions and 4 deletions
+4 -4
View File
@@ -63,17 +63,17 @@ func ShowValidatorCmd(ctx *Context) *cobra.Command {
func ShowAddressCmd(ctx *Context) *cobra.Command {
cmd := &cobra.Command{
Use: "show-address",
Short: "Shows this node's tendermint validator address",
Short: "Shows this node's tendermint validator consensus address",
RunE: func(cmd *cobra.Command, args []string) error {
cfg := ctx.Config
privValidator := pvm.LoadOrGenFilePV(cfg.PrivValidatorFile())
valAddr := (sdk.ValAddress)(privValidator.Address)
valConsAddr := (sdk.ConsAddress)(privValidator.Address)
if viper.GetBool(client.FlagJson) {
return printlnJSON(valAddr)
return printlnJSON(valConsAddr)
}
fmt.Println(valAddr.String())
fmt.Println(valConsAddr.String())
return nil
},
}