From c6b0a80a5ce20b444bb633a6bef915602f783899 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Wed, 1 Dec 2021 12:22:23 +0100 Subject: [PATCH] renmaing ModuleName to SubModuleName for ica controller/host --- .../controller/types/errors.go | 2 +- .../controller/types/keys.go | 6 +++--- .../host/types/errors.go | 2 +- .../27-interchain-accounts/host/types/keys.go | 6 +++--- testing/simapp/app.go | 20 +++++++++---------- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/apps/27-interchain-accounts/controller/types/errors.go b/modules/apps/27-interchain-accounts/controller/types/errors.go index efb316097e4..3a0ade00fe1 100644 --- a/modules/apps/27-interchain-accounts/controller/types/errors.go +++ b/modules/apps/27-interchain-accounts/controller/types/errors.go @@ -6,5 +6,5 @@ import ( // ICA Controller sentinel errors var ( - ErrControllerSubModuleDisabled = sdkerrors.Register(ModuleName, 2, "controller submodule is disabled") + ErrControllerSubModuleDisabled = sdkerrors.Register(SubModuleName, 2, "controller submodule is disabled") ) diff --git a/modules/apps/27-interchain-accounts/controller/types/keys.go b/modules/apps/27-interchain-accounts/controller/types/keys.go index 1f17f79de71..238c8f603f9 100644 --- a/modules/apps/27-interchain-accounts/controller/types/keys.go +++ b/modules/apps/27-interchain-accounts/controller/types/keys.go @@ -1,9 +1,9 @@ package types const ( - // ModuleName defines the interchain accounts controller module name - ModuleName = "icacontroller" + // SubModuleName defines the interchain accounts controller module name + SubModuleName = "icacontroller" // StoreKey is the store key string for the interchain accounts controller module - StoreKey = ModuleName + StoreKey = SubModuleName ) diff --git a/modules/apps/27-interchain-accounts/host/types/errors.go b/modules/apps/27-interchain-accounts/host/types/errors.go index b188ac027c7..b16b4093e5e 100644 --- a/modules/apps/27-interchain-accounts/host/types/errors.go +++ b/modules/apps/27-interchain-accounts/host/types/errors.go @@ -6,5 +6,5 @@ import ( // ICA Host sentinel errors var ( - ErrHostSubModuleDisabled = sdkerrors.Register(ModuleName, 2, "host submodule is disabled") + ErrHostSubModuleDisabled = sdkerrors.Register(SubModuleName, 2, "host submodule is disabled") ) diff --git a/modules/apps/27-interchain-accounts/host/types/keys.go b/modules/apps/27-interchain-accounts/host/types/keys.go index 284284980e4..cb1d2a1b800 100644 --- a/modules/apps/27-interchain-accounts/host/types/keys.go +++ b/modules/apps/27-interchain-accounts/host/types/keys.go @@ -1,9 +1,9 @@ package types const ( - // ModuleName defines the interchain accounts host module name - ModuleName = "icahost" + // SubModuleName defines the interchain accounts host module name + SubModuleName = "icahost" // StoreKey is the store key string for the interchain accounts host module - StoreKey = ModuleName + StoreKey = SubModuleName ) diff --git a/testing/simapp/app.go b/testing/simapp/app.go index 18aba3e1ec6..d1463889779 100644 --- a/testing/simapp/app.go +++ b/testing/simapp/app.go @@ -274,13 +274,13 @@ func NewSimApp( app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey]) scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName) scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) - scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.ModuleName) - scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.ModuleName) + scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) + scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) // NOTE: the IBC mock keeper and application module is used only for testing core IBC. Do // not replicate if you do not need to test core IBC or light clients. scopedIBCMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName) - scopedICAMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName + icacontrollertypes.ModuleName) + scopedICAMockKeeper := app.CapabilityKeeper.ScopeToModule(ibcmock.ModuleName + icacontrollertypes.SubModuleName) // seal capability keeper after scoping modules app.CapabilityKeeper.Seal() @@ -353,14 +353,14 @@ func NewSimApp( mockIBCModule := ibcmock.NewIBCModule(&ibcmock.MockIBCApp{}, scopedIBCMockKeeper) app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper( - appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.ModuleName), + appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName), app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAControllerKeeper, app.MsgServiceRouter(), ) app.ICAHostKeeper = icahostkeeper.NewKeeper( - appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.ModuleName), + appCodec, keys[icahosttypes.StoreKey], app.GetSubspace(icahosttypes.SubModuleName), app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, app.AccountKeeper, scopedICAHostKeeper, app.MsgServiceRouter(), ) @@ -376,9 +376,9 @@ func NewSimApp( // Create static IBC router, add app routes, then set and seal it ibcRouter := porttypes.NewRouter() - ibcRouter.AddRoute(icacontrollertypes.ModuleName, icaControllerIBCModule). - AddRoute(icahosttypes.ModuleName, icaHostIBCModule). - AddRoute(ibcmock.ModuleName+icacontrollertypes.ModuleName, icaControllerIBCModule). // ica with mock auth module stack route to ica (top level of middleware stack) + ibcRouter.AddRoute(icacontrollertypes.SubModuleName, icaControllerIBCModule). + AddRoute(icahosttypes.SubModuleName, icaHostIBCModule). + AddRoute(ibcmock.ModuleName+icacontrollertypes.SubModuleName, icaControllerIBCModule). // ica with mock auth module stack route to ica (top level of middleware stack) AddRoute(ibctransfertypes.ModuleName, transferIBCModule). AddRoute(ibcmock.ModuleName, mockIBCModule) app.IBCKeeper.SetRouter(ibcRouter) @@ -708,8 +708,8 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName) - paramsKeeper.Subspace(icacontrollertypes.ModuleName) - paramsKeeper.Subspace(icahosttypes.ModuleName) + paramsKeeper.Subspace(icacontrollertypes.SubModuleName) + paramsKeeper.Subspace(icahosttypes.SubModuleName) return paramsKeeper }