Skip to content

Commit

Permalink
fix: add missing ibc interfaces to chain client (#3851)
Browse files Browse the repository at this point in the history
* add missing ibc interfaces to chain client

* add changelog

---------

Co-authored-by: Pantani <Pantani>
Co-authored-by: Jerónimo Albi <[email protected]>
  • Loading branch information
Pantani and jeronimoalbi authored Dec 20, 2023
1 parent f668b5d commit 2a4e3a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion ignite/pkg/cosmosanalysis/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 6 additions & 2 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"
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"
Expand Down Expand Up @@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 2a4e3a7

Please sign in to comment.