-
Notifications
You must be signed in to change notification settings - Fork 13
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
Call end block function in each cosmos modules #1683
Conversation
@@ -134,6 +134,7 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { | |||
|
|||
// EndBlock returns the end blocker for the execution module. It returns no validator | |||
// updates. | |||
func (AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { | |||
func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { | |||
EndBlocker(ctx, am.keeper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum end blocker is empty in each module. What is the point of calling it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making sure that it's called when we need it, I was experimenting with the pagination and found this issue
Hum, I'm not sure why this code works and how, but EndBlock is empty and dose nothing in each module. Also you have change BeginBlockers order which on which I'm not sure if they are good. app.mm.SetOrderBeginBlockers(distr.ModuleName, slashing.ModuleName)
>>> app.mm.SetOrderEndBlockers(staking.ModuleName) So I would rather add only this one and check if its' working. |
250663e
to
5d41033
Compare
I just reverted the modification on the begin/end order. Now the PR just call the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think this PR is necessary but it doesn't cause any new issue, so i'm good with merging it
What about calling Order explicit like we disscuss? I'm ok to merge this one too, although as @NicolasMahe point it's not necessary. Also if you want to be consistent you should call BeginBlock as well :P |
I just wanted to revert it and maybe put it in another PR as it creates too much discussion and I want to try to have more details about that. |
The
EndBlocker
of the module was not called by the module and also theseEndBlock
for each module were not called because of a wrong initialization of the app.