Skip to content
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

Pass counterparty portID, channelID in UpgradeCancel #4063

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion modules/core/04-channel/keeper/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,15 @@ func (k Keeper) ChanUpgradeCancel(ctx sdk.Context, portID, channelID string, err
)
}

if err := k.connectionKeeper.VerifyChannelUpgradeError(ctx, portID, channelID, connection, errorReceipt, errorReceiptProof, proofHeight); err != nil {
if err := k.connectionKeeper.VerifyChannelUpgradeError(
ctx,
channel.Counterparty.PortId,
channel.Counterparty.ChannelId,
connection,
errorReceipt,
errorReceiptProof,
proofHeight,
); err != nil {
return errorsmod.Wrap(err, "failed to verify counterparty error receipt")
}

Expand Down
8 changes: 8 additions & 0 deletions modules/core/04-channel/keeper/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,14 @@ func (suite *KeeperTestSuite) TestChanUpgradeCancel() {
},
}

// Create an initial path used only to invoke a ChanOpenInit handshake.
// This bumps the channel identifier generated for chain A on the
// next path used to run the upgrade handshake.
// See issue 4062.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linking #4062

path = ibctesting.NewPath(suite.chainA, suite.chainB)
suite.coordinator.SetupConnections(path)
suite.Require().NoError(path.EndpointA.ChanOpenInit())

for _, tc := range tests {
tc := tc
suite.Run(tc.name, func() {
Expand Down