From 6691cc88fc831c7ed9ec66fd765ee1cf0aaec834 Mon Sep 17 00:00:00 2001 From: Ali Zahid Raja Date: Fri, 30 Sep 2022 20:06:53 +0500 Subject: [PATCH 1/3] renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID --- .../controller/ibc_middleware_test.go | 4 ++-- .../controller/keeper/account.go | 2 +- .../controller/keeper/handshake.go | 16 ++++++++-------- .../controller/keeper/handshake_test.go | 2 +- .../controller/keeper/keeper_test.go | 4 ++-- .../controller/keeper/migrations.go | 2 +- .../controller/keeper/migrations_test.go | 2 +- .../controller/migrations/v6/migrations_test.go | 4 ++-- .../genesis/types/genesis.go | 2 +- .../genesis/types/genesis_test.go | 8 ++++---- .../host/client/cli/query.go | 2 +- .../host/ibc_module_test.go | 4 ++-- .../host/keeper/genesis.go | 2 +- .../host/keeper/genesis_test.go | 4 ++-- .../host/keeper/handshake.go | 8 ++++---- .../host/keeper/keeper_test.go | 4 ++-- modules/apps/27-interchain-accounts/module.go | 4 ++-- .../apps/27-interchain-accounts/module_test.go | 4 ++-- .../simulation/decoder_test.go | 4 ++-- .../27-interchain-accounts/simulation/genesis.go | 2 +- .../simulation/genesis_test.go | 2 +- .../apps/27-interchain-accounts/types/keys.go | 8 ++++---- .../apps/27-interchain-accounts/types/port.go | 2 +- .../27-interchain-accounts/types/port_test.go | 2 +- modules/apps/29-fee/ica_test.go | 2 +- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go index 98c4117a280..daa037e447e 100644 --- a/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go +++ b/modules/apps/27-interchain-accounts/controller/ibc_middleware_test.go @@ -59,8 +59,8 @@ func (suite *InterchainAccountsTestSuite) SetupTest() { func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = icatypes.PortID - path.EndpointB.ChannelConfig.PortID = icatypes.PortID + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED path.EndpointA.ChannelConfig.Version = TestVersion diff --git a/modules/apps/27-interchain-accounts/controller/keeper/account.go b/modules/apps/27-interchain-accounts/controller/keeper/account.go index cb38b258922..2d3b92bd1c2 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/account.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/account.go @@ -51,7 +51,7 @@ func (k Keeper) registerInterchainAccount(ctx sdk.Context, connectionID, portID, } } - msg := channeltypes.NewMsgChannelOpenInit(portID, version, channeltypes.ORDERED, []string{connectionID}, icatypes.PortID, icatypes.ModuleName) + msg := channeltypes.NewMsgChannelOpenInit(portID, version, channeltypes.ORDERED, []string{connectionID}, icatypes.HostPortID, icatypes.ModuleName) handler := k.msgRouter.Handler(msg) res, err := handler(ctx, msg) if err != nil { diff --git a/modules/apps/27-interchain-accounts/controller/keeper/handshake.go b/modules/apps/27-interchain-accounts/controller/keeper/handshake.go index b18b420d067..2485f4e30f7 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/handshake.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/handshake.go @@ -33,12 +33,12 @@ func (k Keeper) OnChanOpenInit( return "", sdkerrors.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s", channeltypes.ORDERED, order) } - if !strings.HasPrefix(portID, icatypes.PortPrefix) { - return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.PortPrefix, portID) + if !strings.HasPrefix(portID, icatypes.ControllerPortPrefix) { + return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.ControllerPortPrefix, portID) } - if counterparty.PortId != icatypes.PortID { - return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.PortID, counterparty.PortId) + if counterparty.PortId != icatypes.HostPortID { + return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.HostPortID, counterparty.PortId) } var metadata icatypes.Metadata @@ -91,12 +91,12 @@ func (k Keeper) OnChanOpenAck( channelID string, counterpartyVersion string, ) error { - if portID == icatypes.PortID { - return sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "portID cannot be host chain port ID: %s", icatypes.PortID) + if portID == icatypes.HostPortID { + return sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "portID cannot be host chain port ID: %s", icatypes.HostPortID) } - if !strings.HasPrefix(portID, icatypes.PortPrefix) { - return sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.PortPrefix, portID) + if !strings.HasPrefix(portID, icatypes.ControllerPortPrefix) { + return sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.ControllerPortPrefix, portID) } var metadata icatypes.Metadata diff --git a/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go b/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go index 3c5a55026b1..8bf395f2405 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/handshake_test.go @@ -290,7 +290,7 @@ func (suite *KeeperTestSuite) TestOnChanOpenAck() { { "invalid port ID - host chain", func() { - path.EndpointA.ChannelConfig.PortID = icatypes.PortID + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID }, false, }, diff --git a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go index 4bb7d32a823..fc4428ce68a 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/keeper_test.go @@ -48,8 +48,8 @@ func (suite *KeeperTestSuite) SetupTest() { func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = icatypes.PortID - path.EndpointB.ChannelConfig.PortID = icatypes.PortID + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED path.EndpointA.ChannelConfig.Version = TestVersion diff --git a/modules/apps/27-interchain-accounts/controller/keeper/migrations.go b/modules/apps/27-interchain-accounts/controller/keeper/migrations.go index 818c469f4ce..27e859070a0 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/migrations.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/migrations.go @@ -24,7 +24,7 @@ func NewMigrator(keeper *Keeper) Migrator { // are owned by the controller submodule and ibc. func (m Migrator) AssertChannelCapabilityMigrations(ctx sdk.Context) error { if m.keeper != nil { - filteredChannels := m.keeper.channelKeeper.GetAllChannelsWithPortPrefix(ctx, icatypes.PortPrefix) + filteredChannels := m.keeper.channelKeeper.GetAllChannelsWithPortPrefix(ctx, icatypes.ControllerPortPrefix) for _, ch := range filteredChannels { name := host.ChannelCapabilityPath(ch.PortId, ch.ChannelId) capability, found := m.keeper.scopedKeeper.GetCapability(ctx, name) diff --git a/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go b/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go index b2387e16a6e..05909486e06 100644 --- a/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go +++ b/modules/apps/27-interchain-accounts/controller/keeper/migrations_test.go @@ -33,7 +33,7 @@ func (suite *KeeperTestSuite) TestAssertChannelCapabilityMigrations() { { "capability not found", func() { - portIDWithPrefix := fmt.Sprintf("%s%s", icatypes.PortPrefix, "port-without-capability") + portIDWithPrefix := fmt.Sprintf("%s%s", icatypes.ControllerPortPrefix, "port-without-capability") suite.chainA.GetSimApp().IBCKeeper.ChannelKeeper.SetChannel(suite.chainA.GetContext(), portIDWithPrefix, ibctesting.FirstChannelID, channeltypes.Channel{ ConnectionHops: []string{ibctesting.FirstConnectionID}, }) diff --git a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go index d97b05c5567..ea0418856bb 100644 --- a/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go +++ b/modules/apps/27-interchain-accounts/controller/migrations/v6/migrations_test.go @@ -32,8 +32,8 @@ func (suite *MigrationsTestSuite) SetupTest() { suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(2)) suite.path = ibctesting.NewPath(suite.chainA, suite.chainB) - suite.path.EndpointA.ChannelConfig.PortID = icatypes.PortID - suite.path.EndpointB.ChannelConfig.PortID = icatypes.PortID + suite.path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + suite.path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID suite.path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED suite.path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED suite.path.EndpointA.ChannelConfig.Version = icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID) diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis.go b/modules/apps/27-interchain-accounts/genesis/types/genesis.go index f2b1d8b7192..5df2ee19194 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis.go @@ -91,7 +91,7 @@ func (gs ControllerGenesisState) Validate() error { // DefaultHostGenesis creates and returns the default interchain accounts HostGenesisState func DefaultHostGenesis() HostGenesisState { return HostGenesisState{ - Port: icatypes.PortID, + Port: icatypes.HostPortID, Params: hosttypes.DefaultParams(), } } diff --git a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go index a959fb6cc1e..8b4690a7557 100644 --- a/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go +++ b/modules/apps/27-interchain-accounts/genesis/types/genesis_test.go @@ -221,7 +221,7 @@ func (suite *GenesisTypesTestSuite) TestValidateHostGenesisState() { }, } - genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.PortID, hosttypes.DefaultParams()) + genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.HostPortID, hosttypes.DefaultParams()) }, false, }, @@ -235,7 +235,7 @@ func (suite *GenesisTypesTestSuite) TestValidateHostGenesisState() { }, } - genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.PortID, hosttypes.DefaultParams()) + genesisState = genesistypes.NewHostGenesisState(activeChannels, []genesistypes.RegisteredInterchainAccount{}, icatypes.HostPortID, hosttypes.DefaultParams()) }, false, }, @@ -256,7 +256,7 @@ func (suite *GenesisTypesTestSuite) TestValidateHostGenesisState() { }, } - genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.PortID, hosttypes.DefaultParams()) + genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.HostPortID, hosttypes.DefaultParams()) }, false, }, @@ -277,7 +277,7 @@ func (suite *GenesisTypesTestSuite) TestValidateHostGenesisState() { }, } - genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.PortID, hosttypes.DefaultParams()) + genesisState = genesistypes.NewHostGenesisState(activeChannels, registeredAccounts, icatypes.HostPortID, hosttypes.DefaultParams()) }, false, }, diff --git a/modules/apps/27-interchain-accounts/host/client/cli/query.go b/modules/apps/27-interchain-accounts/host/client/cli/query.go index 1e61e72aa61..b3ab0972400 100644 --- a/modules/apps/27-interchain-accounts/host/client/cli/query.go +++ b/modules/apps/27-interchain-accounts/host/client/cli/query.go @@ -61,7 +61,7 @@ func GetCmdPacketEvents() *cobra.Command { return err } - channelID, portID := args[0], icatypes.PortID + channelID, portID := args[0], icatypes.HostPortID if err := host.ChannelIdentifierValidator(channelID); err != nil { return err } diff --git a/modules/apps/27-interchain-accounts/host/ibc_module_test.go b/modules/apps/27-interchain-accounts/host/ibc_module_test.go index c68efbf3867..5bd6f916df5 100644 --- a/modules/apps/27-interchain-accounts/host/ibc_module_test.go +++ b/modules/apps/27-interchain-accounts/host/ibc_module_test.go @@ -60,8 +60,8 @@ func (suite *InterchainAccountsTestSuite) SetupTest() { func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = icatypes.PortID - path.EndpointB.ChannelConfig.PortID = icatypes.PortID + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED path.EndpointA.ChannelConfig.Version = TestVersion diff --git a/modules/apps/27-interchain-accounts/host/keeper/genesis.go b/modules/apps/27-interchain-accounts/host/keeper/genesis.go index 7b2255cb0fa..c022c084afa 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/genesis.go +++ b/modules/apps/27-interchain-accounts/host/keeper/genesis.go @@ -35,7 +35,7 @@ func ExportGenesis(ctx sdk.Context, keeper Keeper) genesistypes.HostGenesisState return genesistypes.NewHostGenesisState( keeper.GetAllActiveChannels(ctx), keeper.GetAllInterchainAccounts(ctx), - icatypes.PortID, + icatypes.HostPortID, keeper.GetParams(ctx), ) } diff --git a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go index ca2cf16fb74..49d4e5a238a 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/genesis_test.go @@ -28,7 +28,7 @@ func (suite *KeeperTestSuite) TestInitGenesis() { AccountAddress: interchainAccAddr.String(), }, }, - Port: icatypes.PortID, + Port: icatypes.HostPortID, } keeper.InitGenesis(suite.chainA.GetContext(), suite.chainA.GetSimApp().ICAHostKeeper, genesisState) @@ -66,7 +66,7 @@ func (suite *KeeperTestSuite) TestExportGenesis() { suite.Require().Equal(interchainAccAddr, genesisState.InterchainAccounts[0].AccountAddress) suite.Require().Equal(path.EndpointA.ChannelConfig.PortID, genesisState.InterchainAccounts[0].PortId) - suite.Require().Equal(icatypes.PortID, genesisState.GetPort()) + suite.Require().Equal(icatypes.HostPortID, genesisState.GetPort()) expParams := types.DefaultParams() suite.Require().Equal(expParams, genesisState.GetParams()) diff --git a/modules/apps/27-interchain-accounts/host/keeper/handshake.go b/modules/apps/27-interchain-accounts/host/keeper/handshake.go index 6301cf958c1..c4f2b6c4547 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/handshake.go +++ b/modules/apps/27-interchain-accounts/host/keeper/handshake.go @@ -31,12 +31,12 @@ func (k Keeper) OnChanOpenTry( return "", sdkerrors.Wrapf(channeltypes.ErrInvalidChannelOrdering, "expected %s channel, got %s", channeltypes.ORDERED, order) } - if portID != icatypes.PortID { - return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.PortID, portID) + if portID != icatypes.HostPortID { + return "", sdkerrors.Wrapf(icatypes.ErrInvalidHostPort, "expected %s, got %s", icatypes.HostPortID, portID) } - if !strings.HasPrefix(counterparty.PortId, icatypes.PortPrefix) { - return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.PortPrefix, counterparty.PortId) + if !strings.HasPrefix(counterparty.PortId, icatypes.ControllerPortPrefix) { + return "", sdkerrors.Wrapf(icatypes.ErrInvalidControllerPort, "expected %s{owner-account-address}, got %s", icatypes.ControllerPortPrefix, counterparty.PortId) } var metadata icatypes.Metadata diff --git a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go index fe05e4ae85d..7007a1bb6f7 100644 --- a/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go +++ b/modules/apps/27-interchain-accounts/host/keeper/keeper_test.go @@ -48,8 +48,8 @@ func (suite *KeeperTestSuite) SetupTest() { func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = icatypes.PortID - path.EndpointB.ChannelConfig.PortID = icatypes.PortID + path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED path.EndpointA.ChannelConfig.Version = TestVersion diff --git a/modules/apps/27-interchain-accounts/module.go b/modules/apps/27-interchain-accounts/module.go index ae68f47f91c..a086d679a28 100644 --- a/modules/apps/27-interchain-accounts/module.go +++ b/modules/apps/27-interchain-accounts/module.go @@ -118,8 +118,8 @@ func (am AppModule) InitModule(ctx sdk.Context, controllerParams controllertypes if am.hostKeeper != nil { am.hostKeeper.SetParams(ctx, hostParams) - cap := am.hostKeeper.BindPort(ctx, types.PortID) - if err := am.hostKeeper.ClaimCapability(ctx, cap, ibchost.PortPath(types.PortID)); err != nil { + cap := am.hostKeeper.BindPort(ctx, types.HostPortID) + if err := am.hostKeeper.ClaimCapability(ctx, cap, ibchost.PortPath(types.HostPortID)); err != nil { panic(fmt.Sprintf("could not claim port capability: %v", err)) } } diff --git a/modules/apps/27-interchain-accounts/module_test.go b/modules/apps/27-interchain-accounts/module_test.go index 9b1cf433c43..c96ebb999f2 100644 --- a/modules/apps/27-interchain-accounts/module_test.go +++ b/modules/apps/27-interchain-accounts/module_test.go @@ -59,7 +59,7 @@ func (suite *InterchainAccountsTestSuite) TestInitModule() { expAllowMessages := []string{"sdk.Msg"} hostParams.HostEnabled = true hostParams.AllowMessages = expAllowMessages - suite.Require().False(app.IBCKeeper.PortKeeper.IsBound(ctx, types.PortID)) + suite.Require().False(app.IBCKeeper.PortKeeper.IsBound(ctx, types.HostPortID)) testCases := []struct { name string @@ -123,7 +123,7 @@ func (suite *InterchainAccountsTestSuite) TestInitModule() { suite.Require().True(hostParams.HostEnabled) suite.Require().Equal(expAllowMessages, hostParams.AllowMessages) - suite.Require().True(app.IBCKeeper.PortKeeper.IsBound(ctx, types.PortID)) + suite.Require().True(app.IBCKeeper.PortKeeper.IsBound(ctx, types.HostPortID)) } }) } diff --git a/modules/apps/27-interchain-accounts/simulation/decoder_test.go b/modules/apps/27-interchain-accounts/simulation/decoder_test.go index 955c5a82a98..64f3ea46e10 100644 --- a/modules/apps/27-interchain-accounts/simulation/decoder_test.go +++ b/modules/apps/27-interchain-accounts/simulation/decoder_test.go @@ -24,7 +24,7 @@ func TestDecodeStore(t *testing.T) { Pairs: []kv.Pair{ { Key: []byte(types.PortKeyPrefix), - Value: []byte(types.PortID), + Value: []byte(types.HostPortID), }, { Key: []byte(types.OwnerKeyPrefix), @@ -44,7 +44,7 @@ func TestDecodeStore(t *testing.T) { name string expectedLog string }{ - {"PortID", fmt.Sprintf("Port A: %s\nPort B: %s", types.PortID, types.PortID)}, + {"PortID", fmt.Sprintf("Port A: %s\nPort B: %s", types.HostPortID, types.HostPortID)}, {"Owner", fmt.Sprintf("Owner A: %s\nOwner B: %s", owner, owner)}, {"ActiveChannel", fmt.Sprintf("ActiveChannel A: %s\nActiveChannel B: %s", channelID, channelID)}, {"IsMiddlewareEnabled", fmt.Sprintf("IsMiddlewareEnabled A: %s\nIsMiddlewareEnabled B: %s", "false", "false")}, diff --git a/modules/apps/27-interchain-accounts/simulation/genesis.go b/modules/apps/27-interchain-accounts/simulation/genesis.go index 9f80c952fc1..83f2b3d4b32 100644 --- a/modules/apps/27-interchain-accounts/simulation/genesis.go +++ b/modules/apps/27-interchain-accounts/simulation/genesis.go @@ -52,7 +52,7 @@ func RandomizedGenState(simState *module.SimulationState) { hostGenesisState := genesistypes.HostGenesisState{ ActiveChannels: nil, InterchainAccounts: nil, - Port: types.PortID, + Port: types.HostPortID, Params: hostParams, } diff --git a/modules/apps/27-interchain-accounts/simulation/genesis_test.go b/modules/apps/27-interchain-accounts/simulation/genesis_test.go index eb9fc43ebd6..955b423b010 100644 --- a/modules/apps/27-interchain-accounts/simulation/genesis_test.go +++ b/modules/apps/27-interchain-accounts/simulation/genesis_test.go @@ -50,7 +50,7 @@ func TestRandomizedGenState(t *testing.T) { require.True(t, icaGenesis.HostGenesisState.Params.HostEnabled) require.Equal(t, []string{"*"}, icaGenesis.HostGenesisState.Params.AllowMessages) - require.Equal(t, types.PortID, icaGenesis.HostGenesisState.Port) + require.Equal(t, types.HostPortID, icaGenesis.HostGenesisState.Port) require.Empty(t, icaGenesis.ControllerGenesisState.ActiveChannels) require.Empty(t, icaGenesis.ControllerGenesisState.InterchainAccounts) } diff --git a/modules/apps/27-interchain-accounts/types/keys.go b/modules/apps/27-interchain-accounts/types/keys.go index 449aeff745b..a7118df685d 100644 --- a/modules/apps/27-interchain-accounts/types/keys.go +++ b/modules/apps/27-interchain-accounts/types/keys.go @@ -8,11 +8,11 @@ const ( // ModuleName defines the interchain accounts module name ModuleName = "interchainaccounts" - // PortID is the default port id that the interchain accounts host submodule binds to - PortID = "icahost" + // HostPortID is the default port id that the interchain accounts host submodule binds to + HostPortID = "icahost" - // PortPrefix is the default port prefix that the interchain accounts controller submodule binds to - PortPrefix = "icacontroller-" + // ControllerPortPrefix is the default port prefix that the interchain accounts controller submodule binds to + ControllerPortPrefix = "icacontroller-" // Version defines the current version for interchain accounts Version = "ics27-1" diff --git a/modules/apps/27-interchain-accounts/types/port.go b/modules/apps/27-interchain-accounts/types/port.go index 54949b8a1c4..f1b9ebed825 100644 --- a/modules/apps/27-interchain-accounts/types/port.go +++ b/modules/apps/27-interchain-accounts/types/port.go @@ -13,5 +13,5 @@ func NewControllerPortID(owner string) (string, error) { return "", sdkerrors.Wrap(ErrInvalidAccountAddress, "owner address cannot be empty") } - return fmt.Sprint(PortPrefix, owner), nil + return fmt.Sprint(ControllerPortPrefix, owner), nil } diff --git a/modules/apps/27-interchain-accounts/types/port_test.go b/modules/apps/27-interchain-accounts/types/port_test.go index cdd59582332..e3c138b6c7b 100644 --- a/modules/apps/27-interchain-accounts/types/port_test.go +++ b/modules/apps/27-interchain-accounts/types/port_test.go @@ -22,7 +22,7 @@ func (suite *TypesTestSuite) TestNewControllerPortID() { { "success", func() {}, - fmt.Sprint(types.PortPrefix, TestOwnerAddress), + fmt.Sprint(types.ControllerPortPrefix, TestOwnerAddress), true, }, { diff --git a/modules/apps/29-fee/ica_test.go b/modules/apps/29-fee/ica_test.go index 2515813b7c8..331f5e85abf 100644 --- a/modules/apps/29-fee/ica_test.go +++ b/modules/apps/29-fee/ica_test.go @@ -39,7 +39,7 @@ func NewIncentivizedICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Pa path.EndpointA.ChannelConfig.Version = feeICAVersion path.EndpointB.ChannelConfig.Version = feeICAVersion path.EndpointA.ChannelConfig.PortID = defaultPortID - path.EndpointB.ChannelConfig.PortID = icatypes.PortID + path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID return path } From b4e9184a8b9abfa3c9c819379b21ba20aecc7f94 Mon Sep 17 00:00:00 2001 From: Ali Zahid Raja Date: Fri, 30 Sep 2022 20:13:00 +0500 Subject: [PATCH 2/3] updated changelog.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56127480c83..2247708c7b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -105,6 +105,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (light-clients/06-solomachine) Moving `verifyMisbehaviour` function from update.go to misbehaviour_handle.go. * (apps/27-interchain-accounts) [\#2297](https://github.com/cosmos/ibc-go/pull/2297) Adding cli command to generate ICS27 packet data. * (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to include portID & channelID for better identification of errors. +* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID ### Features From 960ce33e1f7bae69d0dca1ca93848ea3dcbb7828 Mon Sep 17 00:00:00 2001 From: Ali Zahid Raja Date: Mon, 3 Oct 2022 16:27:18 +0500 Subject: [PATCH 3/3] updated changelog.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 460e06adf49..9f5d9ecd9f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -59,6 +59,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (transfer) [\#2034](https://github.com/cosmos/ibc-go/pull/2034) Transfer Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. * (05-port) [\#2025](https://github.com/cosmos/ibc-go/pull/2025) Port Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. * (04-channel) [\#2024](https://github.com/cosmos/ibc-go/pull/2024) Channel Keeper now expects a keeper which fulfills the expected `ScopedKeeper` interface for the capability keeper. +* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID ### State Machine Breaking @@ -93,7 +94,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (light-clients/06-solomachine) Moving `verifyMisbehaviour` function from update.go to misbehaviour_handle.go. * (apps/27-interchain-accounts) [\#2297](https://github.com/cosmos/ibc-go/pull/2297) Adding cli command to generate ICS27 packet data. * (modules/core/keeper) [\#1728](https://github.com/cosmos/ibc-go/pull/2399) Updated channel callback errors to include portID & channelID for better identification of errors. -* (modules/apps/27-interchain-accounts) [\#2433](https://github.com/cosmos/ibc-go/pull/2450) Renamed icatypes.PortPrefix to icatypes.ControllerPortPrefix & icatypes.PortID to icatypes.HostPortID ### Features