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

renmaing ModuleName to SubModuleName for ica controller/host #579

Merged
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 @@ -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")
)
6 changes: 3 additions & 3 deletions modules/apps/27-interchain-accounts/controller/types/keys.go
Original file line number Diff line number Diff line change
@@ -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
)
2 changes: 1 addition & 1 deletion modules/apps/27-interchain-accounts/host/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
6 changes: 3 additions & 3 deletions modules/apps/27-interchain-accounts/host/types/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
)

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
)

// ContainsMsgType returns true if the sdk.Msg TypeURL is present in allowMsgs, otherwise false
Expand Down
20 changes: 10 additions & 10 deletions testing/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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(),
)
Expand All @@ -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)
Expand Down Expand Up @@ -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
}