-
Notifications
You must be signed in to change notification settings - Fork 629
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 new port router for OnChanUpgradeInit #7082
Use new port router for OnChanUpgradeInit #7082
Conversation
@@ -118,22 +118,6 @@ func (im *LegacyIBCModule) OnChanOpenTry( | |||
return reconstructVersion(im.cbs, negotiatedVersions) | |||
} | |||
|
|||
// reconstructVersion will generate the channel version by applying any version wrapping as necessary. | |||
// Version wrapping will only occur if the negotiated version is non=empty and the application is a VersionWrapper. | |||
func reconstructVersion(cbs []ClassicIBCModule, negotiatedVersions []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 just moved this to the bottom of the file since most handlers are not using this.
|
||
return cbs.OnChanUpgradeInit(ctx, portID, channelID, proposedOrder, proposedConnectionHops, proposedVersion) | ||
func (IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, proposedOrder channeltypes.Order, proposedConnectionHops []string, proposedVersion string) (string, error) { | ||
return proposedVersion, nil |
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.
return proposedVersion, nil | |
return "", nil |
to be explicit?
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.
Nice!
} | ||
return cbs.OnChanUpgradeInit(ctx, portID, channelID, proposedOrder, proposedConnectionHops, proposedVersion) | ||
} | ||
|
||
return proposedVersion, nil |
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 think we can return im.keeper.OnChanUpgradeInit()
?
Description
This PR updates the OnChanUpgradeInit implementations.
Note; The assumption exists that all callbacks in a stack must implement the optional
UpgradeModule
interface. This logic was moved into the LegacyIBCModule implementation instead of checking the underlyingim.app
s.closes: #7026
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/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.