-
Notifications
You must be signed in to change notification settings - Fork 597
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
refactor: adding check if channel exists before register counterparty #1339
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1339 +/- ##
==========================================
+ Coverage 80.27% 80.29% +0.01%
==========================================
Files 166 166
Lines 12023 12034 +11
==========================================
+ Hits 9652 9663 +11
Misses 1916 1916
Partials 455 455
|
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.
Wahoo! Very clean work! :)
CHANGELOG.md
Outdated
@@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||
|
|||
### Improvements | |||
|
|||
* (modules/app/29-fee) [\#1339](https://github.com/cosmos/ibc-go/pull/1339) The `RegisterCounterpartyAddress` gRPC endpoint now checks if the channel exists before registering. |
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.
Changelog entry isn't super necessary since we haven't release ics29, but guess it doesn't hurt
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.
Maybe we can address the reversal of parameters in a separate PR?
@@ -101,18 +101,18 @@ func NewPayPacketFeeAsyncTxCmd() *cobra.Command { | |||
// NewRegisterCounterpartyAddress returns the command to create a MsgRegisterCounterpartyAddress | |||
func NewRegisterCounterpartyAddress() *cobra.Command { | |||
cmd := &cobra.Command{ | |||
Use: "register-counterparty [address] [counterparty-address] [channel-id]", | |||
Use: "register-counterparty [address] [counterparty-address] [channel-id] [port-id]", |
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.
It would be more consistent with the rest of CLIs if the order of the arguments is reversed, so [port-id] [channel-id]
instead of [channel-id] [port-id]
.
RunE: func(cmd *cobra.Command, args []string) error { | ||
clientCtx, err := client.GetClientTxContext(cmd) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2]) | ||
msg := types.NewMsgRegisterCounterpartyAddress(args[0], args[1], args[2], args[3]) |
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.
And I think this is wrong because args[3]
is the port-id
, but it should pass the channel-id
as the last argument... But if we revert the order of the CLI parameters, then this will be fine. :)
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.
Good catch.
Description
In order to add this check we needed access to the PortID. I have added portID to the Msg + updated CLI etc. Wdyt?
closes: #1322
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes