-
Notifications
You must be signed in to change notification settings - Fork 647
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
Use connection id instead of channel id in IsMiddlewareEnabled #2260
Use connection id instead of channel id in IsMiddlewareEnabled #2260
Conversation
…se-the-connection-id-instead-of-the-channel-id
@@ -23,7 +23,7 @@ type IBCMiddleware struct { | |||
keeper keeper.Keeper | |||
} | |||
|
|||
// IBCMiddleware creates a new IBCMiddleware given the associated keeper and underlying application | |||
// NewIBCMiddleware creates a new IBCMiddleware given the associated keeper and underlying application |
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.
unrelated docstring fix
@@ -61,6 +62,15 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { | |||
return ctx.Logger().With("module", fmt.Sprintf("x/%s-%s", host.ModuleName, icatypes.ModuleName)) | |||
} | |||
|
|||
// GetConnectionID returns the connection id for the given port and channelIDs. | |||
func (k Keeper) GetConnectionID(ctx sdk.Context, portID, channelID string) (string, error) { |
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.
I chose to add this function rather than export the channelKeeper, as so far it's the only time we've needed.
…lso use connection ID
…ection-id-instead-of-the-channel-id' of https://github.com/cosmos/ibc-go into cian/issue#2235-ismiddlewareenabled-should-use-the-connection-id-instead-of-the-channel-id
portID := keySplit[1] | ||
connectionID := keySplit[2] | ||
channelID := string(iterator.Value()) |
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.
extracted these out to make it more clear which values are being passed into IsMiddlewareEnabled
…se-the-connection-id-instead-of-the-channel-id
…se-the-connection-id-instead-of-the-channel-id
Codecov Report
@@ Coverage Diff @@
## main #2260 +/- ##
==========================================
- Coverage 79.51% 79.43% -0.08%
==========================================
Files 175 175
Lines 12077 12103 +26
==========================================
+ Hits 9603 9614 +11
- Misses 2049 2059 +10
- Partials 425 430 +5
|
…se-the-connection-id-instead-of-the-channel-id
…se-the-connection-id-instead-of-the-channel-id
…se-the-connection-id-instead-of-the-channel-id
…se-the-connection-id-instead-of-the-channel-id
…se-the-connection-id-instead-of-the-channel-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.
Awesome, LGTM!
…se-the-connection-id-instead-of-the-channel-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.
Looks great to me!
if err != nil { | ||
return err | ||
} | ||
|
||
k.SetMiddlewareEnabled(ctx, portID, channelID) | ||
k.SetMiddlewareEnabled(ctx, portID, connectionID) |
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.
Is there an issue that moves this setting (it needs to be moved to be called before registerInterchainAccount
, since it is referenced in OnChanOpenInit
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.
Looks like its covered in #2283
…ection-id-instead-of-the-channel-id' of https://github.com/cosmos/ibc-go into cian/issue#2235-ismiddlewareenabled-should-use-the-connection-id-instead-of-the-channel-id
(cherry picked from commit 6b7d67f) # Conflicts: # modules/apps/27-interchain-accounts/controller/keeper/keeper.go
…ort #2260) (#2319) * Use connection id instead of channel id in IsMiddlewareEnabled (#2260) (cherry picked from commit 6b7d67f) # Conflicts: # modules/apps/27-interchain-accounts/controller/keeper/keeper.go * chore: handle merge conflicts Co-authored-by: Cian Hatton <[email protected]> Co-authored-by: Cian Hatton <[email protected]> Co-authored-by: colin axnér <[email protected]>
Description
This PR updates
IsMiddlewareEnabled
,SetMiddlewareEnabled
andDeleteMiddlewareEnabled
to use portID and connectionID as opposed to portID and channelID.closes: #2235
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