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

fix: v0.50 ibc genesis issue #3767

Merged
merged 9 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
- [#3726](https://github.com/ignite/cli/pull/3726) Update TS client dependencies. Bump vue/react template versions
- [#3728](https://github.com/ignite/cli/pull/3728) Fix wrong parser for proto package names
- [#3729](https://github.com/ignite/cli/pull/3729) Fix broken generator due to caching /tmp include folders
- [#3767](https://github.com/ignite/cli/pull/3767) Fix `v0.50` ibc genesis issue

## [`v0.27.2`](https://github.com/ignite/cli/releases/tag/v0.27.2)

Expand Down
5 changes: 2 additions & 3 deletions ignite/templates/app/files/app/app.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func New(
// However, when registering a module manually (i.e. that does not support app wiring), the module version map
// must be set manually as follow. The upgrade module will de-duplicate the module version map.
//
// app.SetInitChainer(func(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
// app.SetInitChainer(func(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
// app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap())
// return app.App.InitChainer(ctx, req)
// })
Expand Down Expand Up @@ -353,8 +353,7 @@ func (app *App) AppCodec() codec.Codec {

// GetKey returns the KVStoreKey for the provided store key.
func (app *App) GetKey(storeKey string) *storetypes.KVStoreKey {
sk := app.UnsafeFindStoreKey(storeKey)
kvStoreKey, ok := sk.(*storetypes.KVStoreKey)
kvStoreKey, ok := app.UnsafeFindStoreKey(storeKey).(*storetypes.KVStoreKey)
if !ok {
return nil
}
Expand Down
20 changes: 17 additions & 3 deletions ignite/templates/app/files/app/ibc.go.plush
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package app

import (
storetypes "cosmossdk.io/store/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
Expand All @@ -16,6 +17,7 @@ import (
icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types"
ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee"
ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
Expand All @@ -34,6 +36,7 @@ import (
// this line is used by starport scaffolding # ibc/app/import
)

// registerIBCModules register IBC keepers and non dependency inject modules.
func (app *App) registerIBCModules() {
// set up non depinject support modules store keys
if err := app.RegisterStores(
Expand Down Expand Up @@ -162,16 +165,27 @@ func (app *App) registerIBCModules() {
app.ScopedICAHostKeeper = scopedICAHostKeeper
app.ScopedICAControllerKeeper = scopedICAControllerKeeper

// register IBC modules
// register additional types
ibctm.AppModuleBasic{}.RegisterInterfaces(app.interfaceRegistry)
solomachine.AppModuleBasic{}.RegisterInterfaces(app.interfaceRegistry)

// 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{},
Pantani marked this conversation as resolved.
Show resolved Hide resolved
solomachine.AppModule{},
); err != nil {
panic(err)
}
}

// AddIBCModuleManager add the missing ibc modules into the module manager.
Pantani marked this conversation as resolved.
Show resolved Hide resolved
func AddIBCModuleManager(moduleManager module.BasicManager) {
moduleManager[ibcexported.ModuleName] = ibc.AppModule{}
moduleManager[ibctransfertypes.ModuleName] = ibctransfer.AppModule{}
moduleManager[ibcfeetypes.ModuleName] = ibcfee.AppModule{}
moduleManager[icatypes.ModuleName] = icamodule.AppModule{}
moduleManager[capabilitytypes.ModuleName] = capability.AppModule{}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func NewRootCmd() *cobra.Command {
); err != nil {
panic(err)
}
app.AddIBCModuleManager(moduleBasicManager)
Pantani marked this conversation as resolved.
Show resolved Hide resolved

rootCmd := &cobra.Command{
Use: app.Name + "d",
Expand Down
Loading