Skip to content

Commit

Permalink
imp: remove the channel type = ordered checks from both host and cont…
Browse files Browse the repository at this point in the history
…roller (#5578)

* rm checks and tests, amend docustring

* rm unnecessary test
  • Loading branch information
charleenfei authored Jan 11, 2024
1 parent fcf830f commit 3dedb40
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenInit() {
suite.chainA.GetSimApp().ICAControllerKeeper.SetParams(suite.chainA.GetContext(), types.NewParams(false))
}, false,
},
{
"ICA OnChanOpenInit fails - UNORDERED channel", func() {
channel.Ordering = channeltypes.UNORDERED
}, false,
},
{
"ICA auth module callback fails", func() {
suite.chainA.GetSimApp().ICAAuthModule.IBCApp.OnChanOpenInit = func(ctx sdk.Context, order channeltypes.Order, connectionHops []string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import (
)

// OnChanOpenInit performs basic validation of channel initialization.
// The channel order must be ORDERED, the counterparty port identifier
// must be the host chain representation as defined in the types package,
// The counterparty port identifier must be the host chain representation as defined in the types package,
// the channel version must be equal to the version in the types package,
// there must not be an active channel for the specified port identifier,
// and the interchain accounts module must be able to claim the channel
Expand All @@ -31,10 +30,6 @@ func (k Keeper) OnChanOpenInit(
counterparty channeltypes.Counterparty,
version string,
) (string, error) {
if order != channeltypes.ORDERED {
return "", errorsmod.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s", channeltypes.ORDERED, order)
}

if !strings.HasPrefix(portID, icatypes.ControllerPortPrefix) {
return "", errorsmod.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.ControllerPortPrefix, portID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenInit() {
},
false,
},
{
"invalid order - UNORDERED",
func() {
channel.Ordering = channeltypes.UNORDERED
},
false,
},
{
"invalid port ID",
func() {
Expand Down
5 changes: 0 additions & 5 deletions modules/apps/27-interchain-accounts/host/ibc_module_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ func (suite *InterchainAccountsTestSuite) TestOnChanOpenTry() {
}
}, true,
},
{
"ICA callback fails - invalid channel order", func() {
channel.Ordering = channeltypes.UNORDERED
}, false,
},
}

for _, tc := range testCases {
Expand Down
4 changes: 0 additions & 4 deletions modules/apps/27-interchain-accounts/host/keeper/handshake.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ func (k Keeper) OnChanOpenTry(
counterparty channeltypes.Counterparty,
counterpartyVersion string,
) (string, error) {
if order != channeltypes.ORDERED {
return "", errorsmod.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s", channeltypes.ORDERED, order)
}

if portID != icatypes.HostPortID {
return "", errorsmod.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.HostPortID, portID)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ func (suite *KeeperTestSuite) TestOnChanOpenTry() {
path.EndpointB.SetChannel(*channel)
}, false,
},

{
"invalid order - UNORDERED",
func() {
channel.Ordering = channeltypes.UNORDERED
},
false,
},
{
"invalid port ID",
func() {
Expand Down

0 comments on commit 3dedb40

Please sign in to comment.