From 41a984f0aa93556478c4a5a6e1ee032d31808ffb Mon Sep 17 00:00:00 2001 From: LaurensKubat <32776056+LaurensKubat@users.noreply.github.com> Date: Fri, 28 Oct 2022 16:11:59 +0200 Subject: [PATCH 1/2] remove port prefix requirement (#2590) * remove port prefix requirement * chore: remove depcrated test and fix lint * add changelog entry * Update CHANGELOG.md Co-authored-by: Damian Nolan Co-authored-by: Damian Nolan (cherry picked from commit 5f9966bb7576d30bab0438f982a2ecbd23e53ec0) # Conflicts: # modules/apps/27-interchain-accounts/host/keeper/handshake.go --- CHANGELOG.md | 1 + .../apps/27-interchain-accounts/host/keeper/handshake.go | 4 +++- .../27-interchain-accounts/host/keeper/handshake_test.go | 7 ------- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e92a0ee7ea..473cac4d8fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking +* (27-interchain-accounts) [\#2580](https://github.com/cosmos/ibc-go/issues/2580) Removing port prefix requirement from the ICA host channel handshake * (transfer) [\#2377](https://github.com/cosmos/ibc-go/pull/2377) Adding `sequence` to `MsgTransferResponse`. ### Improvements diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake.go b/modules/apps/27-interchain-accounts/host/keeper/handshake.go index 68acca036ad..60717e2f535 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "strings" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -35,10 +34,13 @@ func (k Keeper) OnChanOpenTry( return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.PortID, portID) } +<<<<<<< HEAD if !strings.HasPrefix(counterparty.PortId, icatypes.PortPrefix) { return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.PortPrefix, counterparty.PortId) } +======= +>>>>>>> 5f9966b (remove port prefix requirement (#2590)) var metadata icatypes.Metadata if err := icatypes.ModuleCdc.UnmarshalJSON([]byte(counterpartyVersion), &metadata); err != nil { return "", sdkerrors.Wrapf(icatypes.ErrUnknownDataType, "cannot unmarshal ICS-27 interchain accounts metadata") diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go b/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go index a3472079689..a34c7095f34 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake_test.go @@ -171,13 +171,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() { }, false, }, - { - "invalid counterparty port ID", - func() { - channel.Counterparty.PortId = "invalid-port-id" - }, - false, - }, { "connection not found", func() { From a8e84ed47978388a8bbd3ba6160d751c0355e006 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Fri, 28 Oct 2022 20:53:41 +0200 Subject: [PATCH 2/2] fix conflict --- .../apps/27-interchain-accounts/host/keeper/handshake.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake.go b/modules/apps/27-interchain-accounts/host/keeper/handshake.go index 60717e2f535..663ac058e5f 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake.go @@ -34,13 +34,6 @@ func (k Keeper) OnChanOpenTry( return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.PortID, portID) } -<<<<<<< HEAD - if !strings.HasPrefix(counterparty.PortId, icatypes.PortPrefix) { - return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.PortPrefix, counterparty.PortId) - } - -======= ->>>>>>> 5f9966b (remove port prefix requirement (#2590)) var metadata icatypes.Metadata if err := icatypes.ModuleCdc.UnmarshalJSON([]byte(counterpartyVersion), &metadata); err != nil { return "", sdkerrors.Wrapf(icatypes.ErrUnknownDataType, "cannot unmarshal ICS-27 interchain accounts metadata")