From 2a4e3a74da65fc8b48017046a6b9115e4cec9529 Mon Sep 17 00:00:00 2001 From: Danilo Pantani Date: Wed, 20 Dec 2023 15:28:39 -0300 Subject: [PATCH] fix: add missing ibc interfaces to chain client (#3851) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add missing ibc interfaces to chain client * add changelog --------- Co-authored-by: Pantani Co-authored-by: Jerónimo Albi --- changelog.md | 1 + ignite/pkg/cosmosanalysis/app/app.go | 2 +- ignite/templates/app/files/app/ibc.go.plush | 8 ++++++-- .../app/files/cmd/{{binaryNamePrefix}}d/cmd/root.go.plush | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 7b715484dc..dd2760967a 100644 --- a/changelog.md +++ b/changelog.md @@ -20,6 +20,7 @@ - [#3825](https://github.com/ignite/cli/pull/3825) Fix a minor Keplr type-checking bug in TS client - [#3836](https://github.com/ignite/cli/pull/3836) Add missing IBC commands for scaffolded chain - [#3833](https://github.com/ignite/cli/pull/3833) Improve Cosmos SDK detection to support SDK forks +- [#3851](https://github.com/ignite/cli/pull/3851) Add missing ibc interfaces to chain client ## [`v28.0.0`](https://github.com/ignite/cli/releases/tag/v28.0.0) diff --git a/ignite/pkg/cosmosanalysis/app/app.go b/ignite/pkg/cosmosanalysis/app/app.go index 059d8aa3aa..3501b4f327 100644 --- a/ignite/pkg/cosmosanalysis/app/app.go +++ b/ignite/pkg/cosmosanalysis/app/app.go @@ -260,7 +260,7 @@ func discoverIBCModules(ibcPath string) ([]string, error) { return nil } - if fn.Name.Name != "AddIBCModuleManager" { + if fn.Name.Name != "RegisterIBC" && fn.Name.Name != "AddIBCModuleManager" { return nil } diff --git a/ignite/templates/app/files/app/ibc.go.plush b/ignite/templates/app/files/app/ibc.go.plush index 2fa1ea3766..d0bf4dd3b9 100644 --- a/ignite/templates/app/files/app/ibc.go.plush +++ b/ignite/templates/app/files/app/ibc.go.plush @@ -2,6 +2,7 @@ package app import ( storetypes "cosmossdk.io/store/types" + cdctypes "github.com/cosmos/cosmos-sdk/codec/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" @@ -179,11 +180,14 @@ func (app *App) registerIBCModules() { } } -// AddIBCModuleManager adds the missing IBC modules into the module manager. -func AddIBCModuleManager(moduleManager module.BasicManager) { +// RegisterIBC adds the missing IBC modules and interfaces into the module manager. +func RegisterIBC(moduleManager module.BasicManager, registry cdctypes.InterfaceRegistry) { 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{} + + ibctm.AppModuleBasic{}.RegisterInterfaces(registry) + solomachine.AppModuleBasic{}.RegisterInterfaces(registry) } 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 9015b89c31..c9951d5850 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 @@ -58,7 +58,7 @@ func NewRootCmd() *cobra.Command { // Since the IBC modules don't support dependency injection, we need to // manually add the modules to the basic manager on the client side. // This needs to be removed after IBC supports App Wiring. - app.AddIBCModuleManager(moduleBasicManager) + app.RegisterIBC(moduleBasicManager, clientCtx.InterfaceRegistry) rootCmd := &cobra.Command{ Use: app.Name + "d",