@@ -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