Skip to content

Commit

Permalink
update cli
Browse files Browse the repository at this point in the history
  • Loading branch information
catShaark committed Dec 27, 2024
1 parent 845c81d commit 9c2c883
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions x/bridge/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
"fmt"
"time"

"github.com/spf13/cobra"

Expand All @@ -27,6 +28,7 @@ func GetTxCmd() *cobra.Command {
cmd.AddCommand(CmdBridgeOut())
cmd.AddCommand(CmdRegisterNewCoins())
cmd.AddCommand(CmdDeregisterCoins())
cmd.AddCommand(CmdUpdateEpochDuration())
// this line is used by starport scaffolding # 1

return cmd
Expand Down Expand Up @@ -155,3 +157,32 @@ func CmdRegisterNewCoins() *cobra.Command {

return cmd
}

func CmdUpdateEpochDuration() *cobra.Command {
cmd := &cobra.Command{
Use: "update-epoch-duration [duration]",
Short: "Broadcast message UpdateEpochDuration",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

duration, err := time.ParseDuration(args[0])
if err != nil {
return err
}

msg := &types.MsgUpdateEpochDuration{
Authority: clientCtx.GetFromAddress().String(),
Duration: duration,
}
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
},
}

flags.AddTxFlagsToCmd(cmd)

return cmd
}

0 comments on commit 9c2c883

Please sign in to comment.