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

[Documentation]:Change the initiation order of module when using depinject #22056

Open
QuocThi opened this issue Oct 3, 2024 · 1 comment
Open
Assignees
Labels
T:Docs Changes and features related to documentation.

Comments

@QuocThi
Copy link

QuocThi commented Oct 3, 2024

Summary

Hi Team,
Is there anywhere to change the order of which module should be initialized before and after when use the depinject.

Please correct me if I'm wrong, as I understand we need this import type (usually in app_config.go or app_v2.go):
_ "github.com/cosmos/cosmos-sdk/x/bank" to call the init() function of the bank module to init depinject for it at the start of the app.
I tried to change the order of import line but seem it is not impact to the actual start process. It still run into an error:

panic: can't resolve type github.com/CosmWasm/wasmd/x/wasm/types/types.DistributionKeeper for github.com/CosmWasm/wasmd/x/wasm.ProvideModule (~/workspace/wasmd/x/wasm/module.go:381):
        while resolving:
                types.DistributionKeeper for github.com/CosmWasm/wasmd/x/wasm.ProvideModule

After debug the cosmossdk.io/depinject in container.go I could see that at the time it run init() for wasm there no data of DistributionKeeper, but other module like Bank, Auth have data because it start before the wasm.

Thanks

@QuocThi QuocThi added the T:Docs Changes and features related to documentation. label Oct 3, 2024
@QuocThi QuocThi changed the title [Documentation]: [Documentation]:Change the initiation order of module when using depinject Oct 3, 2024
@julienrbrt julienrbrt self-assigned this Oct 7, 2024
@julienrbrt
Copy link
Member

The import order doesn't really matter. Are you sure you have the distribution module correctly wired and that wasm/types/types.DistributionKeeper matches the distribution module interface?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T:Docs Changes and features related to documentation.
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants