From a21934c8e73a20c26cde9ff111296b48925dd324 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 27 Jan 2025 15:25:29 +0100 Subject: [PATCH] bump sdk and fixes --- .../templates/app/files/app/app_config.go.plush | 3 +++ ignite/templates/app/files/app/ibc.go.plush | 15 ++++++++------- .../cmd/{{binaryNamePrefix}}d/cmd/root.go.plush | 4 +++- ignite/templates/app/files/go.mod.plush | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ignite/templates/app/files/app/app_config.go.plush b/ignite/templates/app/files/app/app_config.go.plush index f64d7f3dfa..9d5e6745ba 100644 --- a/ignite/templates/app/files/app/app_config.go.plush +++ b/ignite/templates/app/files/app/app_config.go.plush @@ -88,6 +88,9 @@ var ( {Account: stakingtypes.NotBondedPoolName, Permissions: []string{authtypes.Burner, stakingtypes.ModuleName}}, {Account: govtypes.ModuleName, Permissions: []string{authtypes.Burner}}, {Account: nft.ModuleName}, + {Account: ibctransfertypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}}, + {Account: ibcfeetypes.ModuleName}, + {Account: icatypes.ModuleName}, // this line is used by starport scaffolding # stargate/app/maccPerms } diff --git a/ignite/templates/app/files/app/ibc.go.plush b/ignite/templates/app/files/app/ibc.go.plush index 53f32b5d39..21bd1a1724 100644 --- a/ignite/templates/app/files/app/ibc.go.plush +++ b/ignite/templates/app/files/app/ibc.go.plush @@ -5,6 +5,7 @@ import ( "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" govtypes "cosmossdk.io/x/gov/types" + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -159,14 +160,14 @@ func (app *App) registerIBCModules(appOpts servertypes.AppOptions) error { // RegisterIBC Since the IBC modules don't support dependency injection, // we need to manually register the modules on the client side. // This needs to be removed after IBC supports App Wiring. -func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule { +func RegisterIBC(codec codec.Codec, registry cdctypes.InterfaceRegistry) map[string]appmodule.AppModule { modules := map[string]appmodule.AppModule{ - ibcexported.ModuleName: ibc.AppModule{}, - ibctransfertypes.ModuleName: ibctransfer.AppModule{}, - ibcfeetypes.ModuleName: ibcfee.AppModule{}, - icatypes.ModuleName: icamodule.AppModule{}, - ibctm.ModuleName: ibctm.AppModule{}, - solomachine.ModuleName: solomachine.AppModule{}, + ibcexported.ModuleName: ibc.NewAppModule(cdc, &ibckeeper.Keeper{}), + ibctransfertypes.ModuleName: ibctransfer.NewAppModule(cdc, ibctransferkeeper.Keeper{}), + ibcfeetypes.ModuleName: ibcfee.NewAppModule(cdc, ibcfeekeeper.Keeper{}), + icatypes.ModuleName: icamodule.NewAppModule(cdc, &icacontrollerkeeper.Keeper{}, &icahostkeeper.Keeper{}), + ibctm.ModuleName: ibctm.NewAppModule(ibctm.NewLightClientModule(cdc, ibcclienttypes.StoreProvider{})), + solomachine.ModuleName: solomachine.NewAppModule(solomachine.NewLightClientModule(cdc, ibcclienttypes.StoreProvider{})), } for _, m := range modules { diff --git a/ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush b/ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush index 5bf5e63f22..5b1007bacb 100644 --- a/ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush +++ b/ignite/templates/app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush @@ -28,6 +28,7 @@ import ( // NewRootCmd creates a new root command for <%= BinaryNamePrefix %>d. It is called once in the main function. func NewRootCmd() *cobra.Command { var ( + cdc codec.Codec autoCliOpts autocli.AppOptions moduleManager *module.Manager clientCtx client.Context @@ -40,6 +41,7 @@ func NewRootCmd() *cobra.Command { ProvideClientContext, ), ), + &cdc, &autoCliOpts, &moduleManager, &clientCtx, @@ -82,7 +84,7 @@ func NewRootCmd() *cobra.Command { // Since the IBC modules don't support dependency injection, we need to // manually register the modules on the client side. // This needs to be removed after IBC supports App Wiring. - ibcModules := app.RegisterIBC(clientCtx.InterfaceRegistry) + ibcModules := app.RegisterIBC(cdc, clientCtx.InterfaceRegistry) for name, mod := range ibcModules { moduleManager.Modules[name] = mod autoCliOpts.Modules[name] = mod diff --git a/ignite/templates/app/files/go.mod.plush b/ignite/templates/app/files/go.mod.plush index 85ae018471..fb3bcdee29 100644 --- a/ignite/templates/app/files/go.mod.plush +++ b/ignite/templates/app/files/go.mod.plush @@ -4,7 +4,7 @@ go 1.23.4 // 0.52 integration replace ( - github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-rc.2 + github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.52.0-rc.2.0.20250127135924-c9d68e4322bb github.com/cosmos/ibc-go/v9 => github.com/cosmos/ibc-go/v9 v9.0.0-20250124215514-f0469954dfc7 // https://github.com/cosmos/ibc-go/pull/7882 )