fix!: update gentx val pub key input parsing (#9827)

This commit is contained in:
Aleksandr Bezobchuk
2021-08-02 11:06:24 -04:00
committed by GitHub
parent 56589f1cc8
commit cbac7fc248
5 changed files with 47 additions and 9 deletions
+3 -4
View File
@@ -77,10 +77,9 @@ $ %s gentx my-key-name 1000000stake --home=/path/to/home/dir --keyring-backend=o
}
// read --pubkey, if empty take it from priv_validator.json
if val, _ := cmd.Flags().GetString(cli.FlagPubKey); val != "" {
err = clientCtx.Codec.UnmarshalJSON([]byte(val), valPubKey)
if err != nil {
return errors.Wrap(err, "failed to unmarshal consensus node public key")
if pkStr, _ := cmd.Flags().GetString(cli.FlagPubKey); pkStr != "" {
if err := clientCtx.Codec.UnmarshalInterfaceJSON([]byte(pkStr), &valPubKey); err != nil {
return errors.Wrap(err, "failed to unmarshal validator public key")
}
}
+1 -2
View File
@@ -46,8 +46,7 @@ func TestInitCmd(t *testing.T) {
}
},
shouldErr: false,
err: nil,
err: nil,
},
}