Skip to content

Commit

Permalink
fix: bridge module cli
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Dec 30, 2024
1 parent 845c81d commit 0d458eb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions x/bridge/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func GetTxCmd() *cobra.Command {

func CmdBridgeIn() *cobra.Command {
cmd := &cobra.Command{
Use: "bridge-in [amount]",
Use: "bridge-in [amount] [receiver]",
Short: "Broadcast message BridgeIn",
Args: cobra.ExactArgs(1),
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
Expand All @@ -52,9 +52,15 @@ func CmdBridgeIn() *cobra.Command {
return err
}

_, err = sdk.AccAddressFromBech32(args[1])
if err != nil {
return err
}

msg := &types.MsgBridgeIn{
Authority: clientCtx.GetFromAddress().String(),
Coin: coin,
Reciever: args[1],
}

return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
Expand Down Expand Up @@ -112,7 +118,7 @@ func CmdDeregisterCoins() *cobra.Command {
}

var denoms []string
denoms = append(denoms, args[0:len(args)-1]...)
denoms = append(denoms, args...)

msg := &types.MsgDeregisterCoins{
Authority: clientCtx.GetFromAddress().String(),
Expand All @@ -131,6 +137,7 @@ func CmdRegisterNewCoins() *cobra.Command {
cmd := &cobra.Command{
Use: "register-coins [amount]",
Short: "Broadcast message RegisterNewCoins",
Example: "realio-networkd tx bridge register-coins 100denoma,200denomb",
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) (err error) {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down

0 comments on commit 0d458eb

Please sign in to comment.