-
Notifications
You must be signed in to change notification settings - Fork 103
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
feat: add begin and end blocker support to module/server #720
Conversation
@@ -35,23 +35,23 @@ type Module struct { | |||
} | |||
|
|||
// NewModule returns a new Module object. | |||
func NewModule(paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper) Module { | |||
func NewModule(paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, bankKeeper ecocredit.BankKeeper) *Module { |
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.
Pointer receiver is required to handle keeper registration in RegisterServices
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.
It doesn't seem like this does any particular ordering, other than registration order which is deterministic. Maybe that's okay since it's a short term fix. It would be good to actually make ecocredit have a begin and end blocker even if they don't do anything yet.
@aaronc x/ecocredit has a registered Begin Blocker (in this PR). It doesn't have end blocker. I can add an empty one.
I don't think we need it (there is only one module, and even with cosmowasm, registration order will work good enough). Once we will Cosmos SDK 0.46 we should migrate to |
the simulation issue does seem to be related to the ecocredit begin blocker |
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.
could you add a test for these changes?
Co-authored-by: Tyler <48813565+technicallyty@users.noreply.github.com>
@robert-zaremba I think simulations are failing because of duplicate prefixes for orm tables. |
Codecov Report
@@ Coverage Diff @@
## master #720 +/- ##
==========================================
+ Coverage 40.25% 40.30% +0.04%
==========================================
Files 124 124
Lines 37215 37246 +31
==========================================
+ Hits 14981 15012 +31
+ Misses 21266 21258 -8
- Partials 968 976 +8
Flags with carried forward coverage won't be shown. Click here to find out more. |
94f9064
to
e4d905c
Compare
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.
Looks good to me. One question. Pre-approving.
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
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.
LGTM. But there are some unrelated changes that need to be reverted. Once that's done ready to approve
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.
approving as @robert-zaremba clarified that the changes to store key prefixes are to fix conflicts introduced in #647
Description
Closes: #689
Initially I started implementing begin and end blocker support through new
Configurator
register functions (similarly to `RegisterGenesisHandlers). However this approach has downsides:So, instead I added Begin and End blocker functions to the Regen
module/server.Module
, which uses modules directly to execute the begin / end blockers.I had to update the module to be mutable - the keeper assignment in RegisterServices wouldn't work otherwise.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change