Skip to content

Commit

Permalink
add counter party channel ID to argument list of on channel open ack (#…
Browse files Browse the repository at this point in the history
…1159)

Co-authored-by: Carlos Rodriguez <[email protected]>
  • Loading branch information
crodriguezvega and Carlos Rodriguez authored Mar 22, 2022
1 parent 4a0e00c commit ab90f07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions modules/apps/29-fee/ibc_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (im IBCModule) OnChanOpenAck(
ctx sdk.Context,
portID,
channelID string,
counterpartyChannelID string,
counterpartyVersion string,
) error {
// If handshake was initialized with fee enabled it must complete with fee enabled.
Expand All @@ -120,11 +121,11 @@ func (im IBCModule) OnChanOpenAck(
}

// call underlying app's OnChanOpenAck callback with the counterparty app version.
return im.app.OnChanOpenAck(ctx, portID, channelID, versionMetadata.AppVersion)
return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, versionMetadata.AppVersion)
}

// call underlying app's OnChanOpenAck callback with the counterparty app version.
return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyVersion)
return im.app.OnChanOpenAck(ctx, portID, channelID, counterpartyChannelID, counterpartyVersion)
}

// OnChanOpenConfirm implements the IBCModule interface
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/29-fee/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (suite *FeeTestSuite) TestOnChanOpenAck() {

// setup mock callback
suite.chainA.GetSimApp().FeeMockModule.IBCApp.OnChanOpenAck = func(
ctx sdk.Context, portID, channelID string, counterpartyVersion string,
ctx sdk.Context, portID, channelID string, counterpartyChannelID string, counterpartyVersion string,
) error {
if counterpartyVersion != ibcmock.Version {
return fmt.Errorf("incorrect mock version")
Expand All @@ -281,7 +281,7 @@ func (suite *FeeTestSuite) TestOnChanOpenAck() {
cbs, ok := suite.chainA.App.GetIBCKeeper().Router.GetRoute(module)
suite.Require().True(ok)

err = cbs.OnChanOpenAck(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, tc.cpVersion)
err = cbs.OnChanOpenAck(suite.chainA.GetContext(), suite.path.EndpointA.ChannelConfig.PortID, suite.path.EndpointA.ChannelID, suite.path.EndpointA.Counterparty.ChannelID, tc.cpVersion)
if tc.expPass {
suite.Require().NoError(err, "unexpected error for case: %s", tc.name)
} else {
Expand Down

0 comments on commit ab90f07

Please sign in to comment.