Skip to content

Commit

Permalink
register capability module and fix genesis order
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani authored and Pantani committed Nov 17, 2023
1 parent 6c6533c commit fac8ad6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
24 changes: 14 additions & 10 deletions ignite/templates/app/files/app/app_config.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import (
_ "github.com/cosmos/cosmos-sdk/x/bank" // import for side-effects
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
_ "github.com/cosmos/cosmos-sdk/x/consensus" // import for side-effects
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
_ "github.com/cosmos/cosmos-sdk/x/crisis" // import for side-effects
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
Expand Down Expand Up @@ -81,7 +82,8 @@ var (
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
genesisModuleOrder = []string{
// cosmos sdk modules
// cosmos-sdk/ibc modules
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
Expand All @@ -90,21 +92,21 @@ var (
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
ibcexported.ModuleName,
genutiltypes.ModuleName,
evidencetypes.ModuleName,
authz.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
feegrant.ModuleName,
group.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
vestingtypes.ModuleName,
circuittypes.ModuleName,
// ibc modules
capabilitytypes.ModuleName,
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
icatypes.ModuleName,
ibcfeetypes.ModuleName,
group.ModuleName,
consensusparamtypes.ModuleName,
circuittypes.ModuleName,
// chain modules
// this line is used by starport scaffolding # stargate/app/initGenesis
}
Expand All @@ -115,13 +117,14 @@ var (
// NOTE: staking module is required if HistoricalEntries param > 0
// NOTE: capability module's beginblocker must come before any modules using capabilities (e.g. IBC)
beginBlockers = []string{
// cosmos sdk modules
// cosmos sdk modules
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
authz.ModuleName,
genutiltypes.ModuleName,
// ibc modules
capabilitytypes.ModuleName,
ibcexported.ModuleName,
Expand All @@ -133,12 +136,13 @@ var (
}

endBlockers = []string{
// cosmos sdk modules
// cosmos sdk modules
crisistypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
feegrant.ModuleName,
group.ModuleName,
genutiltypes.ModuleName,
// ibc modules
ibcexported.ModuleName,
ibctransfertypes.ModuleName,
Expand Down
11 changes: 8 additions & 3 deletions ignite/templates/app/files/app/ibc.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/cosmos/ibc-go/modules/capability"
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types"
icamodule "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts"
Expand Down Expand Up @@ -50,8 +51,8 @@ func (app *App) registerIBCModules() {
for _, m := range []string{
ibctransfertypes.ModuleName,
ibcexported.ModuleName,
icahosttypes.SubModuleName,
icacontrollertypes.SubModuleName,
icahosttypes.SubModuleName,
} {
app.ParamsKeeper.Subspace(m)
}
Expand Down Expand Up @@ -161,12 +162,16 @@ func (app *App) registerIBCModules() {
app.ScopedICAHostKeeper = scopedICAHostKeeper
app.ScopedICAControllerKeeper = scopedICAControllerKeeper

app.RegisterModules(
// register IBC modules
if err := app.RegisterModules(
ibc.NewAppModule(app.IBCKeeper),
ibctransfer.NewAppModule(app.TransferKeeper),
ibcfee.NewAppModule(app.IBCFeeKeeper),
icamodule.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper),
capability.NewAppModule(app.appCodec, *app.CapabilityKeeper, false),
ibctm.AppModule{},
solomachine.AppModule{},
)
); err != nil {
panic(err)
}
}

0 comments on commit fac8ad6

Please sign in to comment.