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

Hooks have not initialized keepers because of incorrect ordering of initialization in app.go #3019

Closed
yurivin opened this issue Oct 31, 2022 · 0 comments · Fixed by #3031
Closed
Assignees
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding. type:error Something isn't working

Comments

@yurivin
Copy link

yurivin commented Oct 31, 2022

Describe the bug
Hooks have keepers not initialized because scaffold command does not has correct order of keepers & hooks initialization.

  1. We have staking hooks in default scaffolded chain.
  2. Newly scaffolded module code generates after default staking hooks initialization.
  3. Once we add staking hooks for a new module, hooks does not have keepers initialized, because ordering of initialization in app.go affects the state.

To reproduce
Steps to reproduce the behavior:

  1. Scaffold new chain
  2. Scaffold new module
  3. Add staking hook for a new module
  4. Debug/test new hook with call to keeper.

What version are you using?

$ ignite version
Ignite CLI version:	v0.25.1
Ignite CLI build date:	2022-10-20T15:52:00Z
Ignite CLI source hash:	cc393a9b59a8792b256432fafb472e5ac0738f7c
Cosmos SDK version:	v0.46.3
Your OS:		                linux
Your arch:		        amd64
Your Node.js version:	v16.17.1
Your go version:	       go version go1.19.2 linux/amd64
Your uname -a:	       Linux  5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Possible solution

  1. Manage to separate keepers & hooks initialization in app.go. So new modules initialization code always generated before hooks configuration in app.go including default hooks required by cosmos-sdk.
@yurivin yurivin added the type:error Something isn't working label Oct 31, 2022
@yurivin yurivin changed the title Hooks have not initialized keeper because of incorrect order of initialization in app.go Hooks have not initialized keepers because of incorrect ordering of initialization in app.go Oct 31, 2022
@aljo242 aljo242 added the component:scaffold Feature, enhancement, or refactor related to scaffolding. label Oct 31, 2022
@aljo242 aljo242 self-assigned this Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:scaffold Feature, enhancement, or refactor related to scaffolding. type:error Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants