Skip to content

Commit

Permalink
fix(sequencer): add sequencer decrease bond cli command (#1196)
Browse files Browse the repository at this point in the history
  • Loading branch information
zale144 authored Sep 5, 2024
1 parent 094de0c commit 004462d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions x/sequencer/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func GetTxCmd() *cobra.Command {
cmd.AddCommand(CmdUpdateSequencer())
cmd.AddCommand(CmdUnbond())
cmd.AddCommand(CmdIncreaseBond())
cmd.AddCommand(CmdDecreaseBond())

return cmd
}
Expand Down Expand Up @@ -172,3 +173,34 @@ func CmdIncreaseBond() *cobra.Command {

return cmd
}

func CmdDecreaseBond() *cobra.Command {
cmd := &cobra.Command{
Use: "decrease-bond [amount]",
Short: "Decrease the bond of a sequencer",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
amount := args[0]
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

amountCoin, err := sdk.ParseCoinNormalized(amount)
if err != nil {
return err
}

msg := types.NewMsgDecreaseBond(
clientCtx.GetFromAddress().String(),
amountCoin,
)

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}

flags.AddTxFlagsToCmd(cmd)

return cmd
}

0 comments on commit 004462d

Please sign in to comment.