Merge PR #2841: Check whether key passed with --name exists before redirecting to tx create-validator
* Check whether key passed with --name exists before redirecting to tx create-validator * Update PENDING.md
This commit is contained in:
commit
9a37066405
|
@ -8,6 +8,7 @@ BREAKING CHANGES
|
|||
* [cli] [\#2728](https://github.com/cosmos/cosmos-sdk/pull/2728) Seperate `tx` and `query` subcommands by module
|
||||
* [cli] [\#2727](https://github.com/cosmos/cosmos-sdk/pull/2727) Fix unbonding command flow
|
||||
* [cli] [\#2786](https://github.com/cosmos/cosmos-sdk/pull/2786) Fix redelegation command flow
|
||||
* [cli] [\#2804](https://github.com/cosmos/cosmos-sdk/issues/2804) Check whether key exists before passing it on to `tx create-validator`.
|
||||
|
||||
* Gaia
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ package init
|
|||
import (
|
||||
"fmt"
|
||||
"github.com/cosmos/cosmos-sdk/client"
|
||||
"github.com/cosmos/cosmos-sdk/client/keys"
|
||||
"github.com/cosmos/cosmos-sdk/cmd/gaia/app"
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
"github.com/cosmos/cosmos-sdk/server"
|
||||
|
@ -61,6 +62,14 @@ following delegation and commission default parameters:
|
|||
return err
|
||||
}
|
||||
|
||||
kb, err := keys.GetKeyBaseFromDir(viper.GetString(flagClientHome))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err = kb.Get(viper.GetString(client.FlagName)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Read --pubkey, if empty take it from priv_validator.json
|
||||
if valPubKeyString := viper.GetString(cli.FlagPubKey); valPubKeyString != "" {
|
||||
valPubKey, err = sdk.GetConsPubKeyBech32(valPubKeyString)
|
||||
|
|
Loading…
Reference in New Issue