From f9b6bdb61f5b485888834bcc296edabd6d8a5664 Mon Sep 17 00:00:00 2001 From: Aditya Sripal Date: Thu, 26 Jul 2018 13:21:22 -0700 Subject: [PATCH 1/2] Removed default value for staking. Must now specify amount flag or it will error --- x/stake/client/cli/flags.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/stake/client/cli/flags.go b/x/stake/client/cli/flags.go index 79358f16d76a..0bc85bf5f0af 100644 --- a/x/stake/client/cli/flags.go +++ b/x/stake/client/cli/flags.go @@ -34,7 +34,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") fsDescription.String(FlagMoniker, "[do-not-modify]", "validator name") From 0ca18ffb115f89b50418b0fc54c7e8b172ecc968 Mon Sep 17 00:00:00 2001 From: Aditya Sripal Date: Thu, 26 Jul 2018 13:46:59 -0700 Subject: [PATCH 2/2] add to pending and better error msg --- PENDING.md | 3 ++- x/stake/client/cli/tx.go | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/PENDING.md b/PENDING.md index 9a92a7c0f9d0..ec7941b86fa9 100644 --- a/PENDING.md +++ b/PENDING.md @@ -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` \ No newline at end of file +* \#1799 Fix `gaiad export` +* \#1828 Force user to specify amount on create-validator command by removing default \ No newline at end of file diff --git a/x/stake/client/cli/tx.go b/x/stake/client/cli/tx.go index bfcd2ccac8f5..218c1f5567b5 100644 --- a/x/stake/client/cli/tx.go +++ b/x/stake/client/cli/tx.go @@ -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 }