Skip to content

Commit

Permalink
Merge PR #1841: Must specify amount flag
Browse files Browse the repository at this point in the history
* Removed default value for staking. Must now specify amount flag or it will error
* add to pending and better error msg
  • Loading branch information
AdityaSripal authored and cwgoes committed Jul 26, 2018
1 parent 12ef51d commit 74e06d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion x/stake/client/cli/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 5 additions & 1 deletion x/stake/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 74e06d8

Please sign in to comment.