diff --git a/CHANGELOG.md b/CHANGELOG.md index 27465474538..c1604ed6e20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Client Breaking Changes * [\#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) Remove legacy REST API. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/master/migrations/rest.html) to migrate to the new REST endpoints. +* [\#9781](https://github.com/cosmos/cosmos-sdk/pull/9781) Improve`withdraw-all-rewards` UX when broadcast mode `async` or `async` is used. ### CLI Breaking Changes diff --git a/x/distribution/client/cli/tx.go b/x/distribution/client/cli/tx.go index 09567630b89..ccbf5d8c6db 100644 --- a/x/distribution/client/cli/tx.go +++ b/x/distribution/client/cli/tx.go @@ -23,7 +23,7 @@ var ( ) const ( - MaxMessagesPerTxDefault = 5 + MaxMessagesPerTxDefault = 0 ) // NewTxCmd returns a root CLI command handler for all x/distribution transaction commands. @@ -169,9 +169,8 @@ $ %[1]s tx distribution withdraw-all-rewards --from mykey chunkSize, _ := cmd.Flags().GetInt(FlagMaxMessagesPerTx) if clientCtx.BroadcastMode != flags.BroadcastBlock && chunkSize > 0 { - cmd.Println("Cannot use broadcast mode %[1]s with %[2]s != 0. Forcing %[2]s to 0", + return fmt.Errorf("cannot use broadcast mode %[1]s with %[2]s != 0", clientCtx.BroadcastMode, FlagMaxMessagesPerTx) - chunkSize = 0 } return newSplitAndApply(tx.GenerateOrBroadcastTxCLI, clientCtx, cmd.Flags(), msgs, chunkSize)