Merge PR #1841: Must specify amount flag

* Removed default value for staking. Must now specify amount flag or it will error
* add to pending and better error msg
This commit is contained in:
Aditya 2018-07-26 14:41:24 -07:00 committed by Christopher Goes
parent 12ef51dc7a
commit 74e06d8b96
3 changed files with 8 additions and 3 deletions

View File

@ -54,4 +54,5 @@ BUG FIXES
* \#1787 Fixed bug where Tally fails due to revoked/unbonding validator
* \#1766 Fixes bad example for keybase identity
* \#1804 Fixes gen-tx genesis generation logic temporarily until upstream updates
* \#1799 Fix `gaiad export`
* \#1799 Fix `gaiad export`
* \#1828 Force user to specify amount on create-validator command by removing default

View File

@ -37,7 +37,7 @@ var (
func init() {
fsPk.String(FlagPubKey, "", "Go-Amino encoded hex PubKey of the validator. For Ed25519 the go-amino prepend hex is 1624de6220")
fsAmount.String(FlagAmount, "1steak", "Amount of coins to bond")
fsAmount.String(FlagAmount, "", "Amount of coins to bond")
fsShares.String(FlagSharesAmount, "", "Amount of source-shares to either unbond or redelegate as a positive integer or decimal")
fsShares.String(FlagSharesPercent, "", "Percent of source-shares to either unbond or redelegate as a positive integer or decimal >0 and <=1")
fsDescriptionCreate.String(FlagMoniker, "", "validator name")

View File

@ -24,7 +24,11 @@ func GetCmdCreateValidator(cdc *wire.Codec) *cobra.Command {
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.NewCoreContextFromViper().WithDecoder(authcmd.GetAccountDecoder(cdc))
amount, err := sdk.ParseCoin(viper.GetString(FlagAmount))
amounstStr := viper.GetString(FlagAmount)
if amounstStr == "" {
return fmt.Errorf("Must specify amount to stake using --amount")
}
amount, err := sdk.ParseCoin(amounstStr)
if err != nil {
return err
}