-
Notifications
You must be signed in to change notification settings - Fork 610
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
imp: add passthrough handlers for callbacks mw module #5376
imp: add passthrough handlers for callbacks mw module #5376
Conversation
…he-channel-upgradability-application-callbacks-for-mod/callbacks
…he-channel-upgradability-application-callbacks-for-mod/callbacks
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 OnChanUpgradeConfirm
is missing?
would be good to add an interface assertion at the top!
var _ porttypes.UpgradeableModule = (*IBCMiddleware)(nil)
…he-channel-upgradability-application-callbacks-for-mod/callbacks
…he-channel-upgradability-application-callbacks-for-mod/callbacks
This reverts commit 0665746.
func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, version string) (string, error) { | ||
cbs, ok := im.app.(porttypes.UpgradableModule) | ||
if !ok { | ||
return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack") |
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.
nit: these err messages seem slightly off structurally wise?
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 so? what would you expect them to look like?
I think this is how I structured them in the initial PR for core and other mods like fee etc, I'm open to suggestions if you want to open a PR and address all of them together after this then go ahead!
@@ -20,6 +20,7 @@ import ( | |||
var ( | |||
_ porttypes.Middleware = (*IBCMiddleware)(nil) | |||
_ porttypes.PacketDataUnmarshaler = (*IBCMiddleware)(nil) | |||
_ porttypes.UpgradableModule = (*IBCMiddleware)(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 assume its intensional that we never added an app upgrade callback for chanUpgradeConfirm
, its been so long that I don't really remember, but I think it was
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.
yes it is intentional. I think there's nothing to do in that step since it is just acknowledging that the counterparty set your timeout timer
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.
lgtm!
func (im IBCMiddleware) OnChanUpgradeInit(ctx sdk.Context, portID, channelID string, order channeltypes.Order, connectionHops []string, version string) (string, error) { | ||
cbs, ok := im.app.(porttypes.UpgradableModule) | ||
if !ok { | ||
return "", errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack") |
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 so? what would you expect them to look like?
I think this is how I structured them in the initial PR for core and other mods like fee etc, I'm open to suggestions if you want to open a PR and address all of them together after this then go ahead!
…he-channel-upgradability-application-callbacks-for-mod/callbacks
Description
closes: #4575
Commit Message / Changelog Entry
see the guidelines for commit messages. (view raw markdown for examples)
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.Files changed
in the Github PR explorer.Codecov Report
in the comment section below once CI passes.