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

Template RegisterIBC func needs app module adaptor for registering interfaces on cdc #3994

Closed
damiannolan opened this issue Feb 28, 2024 · 0 comments · Fixed by #3995
Closed

Comments

@damiannolan
Copy link

Describe the bug

It seems that when RegisterIBC is called and the modules are looped over and an interface assertion is performed to call RegisterInterfaces that we should be handling the appmodule with the same adaptor which @julienrbrt used to fix genesis issues.

See here:

for _, module := range modules {
if mod, ok := module.(interface {
RegisterInterfaces(registry cdctypes.InterfaceRegistry)
}); ok {
mod.RegisterInterfaces(registry)
}
}

To reproduce

Generate a new app using the ignite cli and try to use some ibc types registered on the cdc. E.g. 08-wasm.

Quick diff from my local env:

--- a/gm/app/ibc.go
+++ b/gm/app/ibc.go
@@ -4,6 +4,7 @@ import (
        "cosmossdk.io/core/appmodule"
        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"
        govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
@@ -203,8 +204,9 @@ func RegisterIBC(registry cdctypes.InterfaceRegistry) map[string]appmodule.AppMo
                ibcwasmtypes.ModuleName:     ibcwasm.AppModule{},
        }

-       for _, module := range modules {
-               if mod, ok := module.(interface {
+       for name, m := range modules {
+               ibcModule := module.CoreAppModuleBasicAdaptor(name, m)
+               if mod, ok := ibcModule.(interface {
                        RegisterInterfaces(registry cdctypes.InterfaceRegistry)
                }); ok {
                        mod.RegisterInterfaces(registry)

What version are you using?

Ignite CLI version:             v28.2.0
Ignite CLI build date:          2024-02-06T11:21:56Z
Ignite CLI source hash:         af25183a2d312aa4d679e65e3d627025b17a7120
Ignite CLI config version:      v1
Cosmos SDK version:             v0.50.3
Your OS:                        darwin
Your arch:                      amd64
Your Node.js version:           v14.15.0
Your go version:                go version go1.22.0 darwin/amd64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant