Skip to content

Commit 9c508d2

Browse files
feat: CLI cmd for MsgRegisterCounterpartyAddress (#987)
* feat: CLI cmd for MsgRegisterCounterpartyAddress * fix: examples * Update modules/apps/29-fee/client/cli/tx.go Co-authored-by: colin axnér <[email protected]> * Update modules/apps/29-fee/client/cli/tx.go Co-authored-by: colin axnér <[email protected]> * chore: remove print * nit: update address for counterparty Co-authored-by: colin axnér <[email protected]>
1 parent fcea26d commit 9c508d2

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

modules/apps/29-fee/client/cli/cli.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func NewTxCmd() *cobra.Command {
3333

3434
txCmd.AddCommand(
3535
NewPayPacketFeeAsyncTxCmd(),
36+
NewRegisterCounterpartyAddress(),
3637
)
3738

3839
return txCmd

modules/apps/29-fee/client/cli/tx.go

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command {
2828
Use: "pay-packet-fee [src-port] [src-channel] [sequence]",
2929
Short: "Pay a fee to incentivize an existing IBC packet",
3030
Long: strings.TrimSpace(`Pay a fee to incentivize an existing IBC packet.`),
31-
Example: fmt.Sprintf("%s tx pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName),
31+
Example: fmt.Sprintf("%s tx ibc-fee pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName),
3232
Args: cobra.ExactArgs(3),
3333
RunE: func(cmd *cobra.Command, args []string) error {
3434
clientCtx, err := client.GetClientTxContext(cmd)
@@ -97,3 +97,28 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command {
9797

9898
return cmd
9999
}
100+
101+
// NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress
102+
func NewRegisterCounterpartyAddress() *cobra.Command {
103+
cmd := &cobra.Command{
104+
Use: "register-counterparty [address] [counterparty-address] [channel-id]",
105+
Short: "Register a counterparty relayer address on a given channel.",
106+
Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`),
107+
Example: fmt.Sprintf("%s tx ibc-fee register-counterparty cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh osmo1v5y0tz01llxzf4c2afml8s3awue0ymju22wxx2 channel-0", version.AppName),
108+
Args: cobra.ExactArgs(3),
109+
RunE: func(cmd *cobra.Command, args []string) error {
110+
clientCtx, err := client.GetClientTxContext(cmd)
111+
if err != nil {
112+
return err
113+
}
114+
115+
msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2])
116+
117+
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg)
118+
},
119+
}
120+
121+
flags.AddTxFlagsToCmd(cmd)
122+
123+
return cmd
124+
}

0 commit comments

Comments
 (0)