From 504749292f5bda51b7c8c09b8040e1c230f96610 Mon Sep 17 00:00:00 2001 From: Sean King Date: Tue, 18 Jan 2022 09:16:44 +0100 Subject: [PATCH] refactor: app version + add comment --- modules/apps/29-fee/ibc_module.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/apps/29-fee/ibc_module.go b/modules/apps/29-fee/ibc_module.go index 1b54981d7ea..ac4ea21ca52 100644 --- a/modules/apps/29-fee/ibc_module.go +++ b/modules/apps/29-fee/ibc_module.go @@ -56,6 +56,8 @@ func (im IBCModule) OnChanOpenInit( } // OnChanOpenTry implements the IBCModule interface +// If the channel is not fee enabled the underlying application version will be returned +// If the channel is fee enabled we merge the underlying application version with the ics29 version func (im IBCModule) OnChanOpenTry( ctx sdk.Context, order channeltypes.Order, @@ -86,11 +88,11 @@ func (im IBCModule) OnChanOpenTry( return "", err } - if im.keeper.IsFeeEnabled(ctx, portID, channelID) { - return channeltypes.MergeChannelVersions(types.Version, appVersion), nil + if !im.keeper.IsFeeEnabled(ctx, portID, channelID) { + return appVersion, nil } - return appVersion, nil + return channeltypes.MergeChannelVersions(types.Version, appVersion), nil } // OnChanOpenAck implements the IBCModule interface