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

imp: remove the channel type = ordered checks from both host and controller #5578

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
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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

docustring can be updated ahora to remove mention of 'must be 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
Loading