Skip to content

Commit d9e5021

Browse files
mergify[bot]mmsqe
andauthored
fix(cli): failed to convert address field in withdraw-validator-commission (backport #25485) (#25489)
Co-authored-by: mmsqe <[email protected]>
1 parent 85492af commit d9e5021

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,13 @@ Ref: https://keepachangelog.com/en/1.0.0/
3939
## UNRELEASED
4040

4141
### Features
42+
4243
* (crypto/ledger) [#25435](https://github.com/cosmos/cosmos-sdk/pull/25435) Add SetDERConversion to reset skipDERConversion and App name for ledger.
4344

45+
### Bug Fixes
46+
47+
* (cli) [#25485](https://github.com/cosmos/cosmos-sdk/pull/25485) Avoid failed to convert address field in `withdraw-validator-commission` cmd.
48+
4449
## [v0.53.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.53.3) - 2025-07-25
4550

4651
This patch update also includes minor dependency bumps.

x/distribution/client/cli/tx.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ func NewTxCmd(valAc, ac address.Codec) *cobra.Command {
4343
NewSetWithdrawAddrCmd(ac),
4444
NewFundCommunityPoolCmd(ac),
4545
NewDepositValidatorRewardsPoolCmd(valAc, ac),
46+
NewWithdrawValidatorCommissionCmd(valAc, ac),
4647
)
4748

4849
return distTxCmd
@@ -304,3 +305,30 @@ func NewDepositValidatorRewardsPoolCmd(valCodec, ac address.Codec) *cobra.Comman
304305

305306
return cmd
306307
}
308+
309+
// NewWithdrawValidatorCommissionCmd returns a CLI command handler for creating a MsgWithdrawValidatorCommission transaction.
310+
func NewWithdrawValidatorCommissionCmd(valCodec, ac address.Codec) *cobra.Command {
311+
cmd := &cobra.Command{
312+
Use: "withdraw-validator-commission [validator-addr]",
313+
Short: "Withdraw commissions from a validator address (must be a validator operator)",
314+
Args: cobra.ExactArgs(1),
315+
RunE: func(cmd *cobra.Command, args []string) error {
316+
clientCtx, err := client.GetClientTxContext(cmd)
317+
if err != nil {
318+
return err
319+
}
320+
_, err = ac.BytesToString(clientCtx.GetFromAddress())
321+
if err != nil {
322+
return err
323+
}
324+
_, err = valCodec.StringToBytes(args[0])
325+
if err != nil {
326+
return err
327+
}
328+
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), types.NewMsgWithdrawValidatorCommission(args[0]))
329+
},
330+
}
331+
332+
flags.AddTxFlagsToCmd(cmd)
333+
return cmd
334+
}

0 commit comments

Comments
 (0)