Skip to content

Commit

Permalink
update for cbs routing
Browse files Browse the repository at this point in the history
  • Loading branch information
charleenfei committed Dec 12, 2023
1 parent b91617b commit 05f7685
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,11 @@ func (IBCMiddleware) OnChanUpgradeTry(ctx sdk.Context, portID, channelID string,

// OnChanUpgradeAck implements the IBCModule interface
func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, counterpartyVersion string) error {
cbs, ok := im.app.(porttypes.UpgradableModule)
if !ok {
return errorsmod.Wrap(porttypes.ErrInvalidRoute, "upgrade route not found to module in application callstack")
}

if !im.keeper.GetParams(ctx).ControllerEnabled {
return types.ErrControllerSubModuleDisabled
}
Expand All @@ -280,7 +285,7 @@ func (im IBCMiddleware) OnChanUpgradeAck(ctx sdk.Context, portID, channelID, cou
}

if im.app != nil && im.keeper.IsMiddlewareEnabled(ctx, portID, connectionID) {
return im.app.OnChanUpgradeAck(ctx, portID, channelID, counterpartyVersion)
return cbs.OnChanUpgradeAck(ctx, portID, channelID, counterpartyVersion)
}

return nil
Expand Down

0 comments on commit 05f7685

Please sign in to comment.