-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: CLI cmd for MsgRegisterCounterpartyAddress #987
Changes from 2 commits
ed50980
7cec663
67e1286
019c2d4
0cd34bc
af51847
3371d51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { | |
Use: "pay-packet-fee [src-port] [src-channel] [sequence]", | ||
Short: "Pay a fee to incentivize an existing IBC packet", | ||
Long: strings.TrimSpace(`Pay a fee to incentivize an existing IBC packet.`), | ||
Example: fmt.Sprintf("%s tx pay-packet-fee transfer channel-0 1 --recv-fee 10stake --ack-fee 10stake --timeout-fee 10stake", version.AppName), | ||
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), | ||
Args: cobra.ExactArgs(3), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
clientCtx, err := client.GetClientTxContext(cmd) | ||
|
@@ -97,3 +97,30 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { | |
|
||
return cmd | ||
} | ||
|
||
// NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress | ||
func NewRegisterCounterpartyAddress() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "register-counter-party [address] [counterparty-address] [channel-id]", | ||
seantking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Short: "Register a counterparty relayer address on a given channel.", | ||
Long: strings.TrimSpace(`Register a counterparty relayer address on a given channel.`), | ||
Example: fmt.Sprintf("%s tx ibc-fee register-counter-party cosmos1rsp837a4kvtgp2m4uqzdge0zzu6efqgucm0qdh cosmoss1sp921a4tttgpln6rqhdqe0zzu6efqgucm0qdh channel-0", version.AppName), | ||
seantking marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Args: cobra.ExactArgs(3), | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
fmt.Print(args[0], args[1], args[2]) | ||
colin-axner marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it make sense to validate There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) | ||
}, | ||
} | ||
|
||
flags.AddTxFlagsToCmd(cmd) | ||
|
||
return cmd | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about doing instead
tx ibc fee
(ortx ibc incentivise
)? We have undertx
currentlyibc
andibc-transfer
, should we try to group things under theibc
subcommand? Maybe this requires some discussion to think about the direction we want to go regarding cli commands and if refactoring would be needed for the commands we currently have.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising this point. I think it's worthy of discussion. I think it's worth merging in this PR as-is for now and following up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be difficult to do since then certain applications maintained by us can be in
ibc
subcommand. But third-party ibc applications won't be. This will make it confusing if those apps are in same binary, since it won't be clear why some ibc apps get to be inibc
subcommand and others aren'tThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @AdityaSripal. Yes, @colin-axner also shared the same concern with me. I will just open an issue for now to work on it in the future. So as @seantking suggests it's good to merge as is.