Created
July 5, 2022 00:35
-
-
Save zeroFruit/6aa3a1d0a1c9fcf31dcb14d72a03e5b5 to your computer and use it in GitHub Desktop.
Cosmos Dev Series: Cosmos-SDK-based Blockchain Upgrade - x/gov
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // EndBlocker called every block, process inflation, update validator set. | |
| func EndBlocker(ctx sdk.Context, keeper keeper.Keeper) { | |
| keeper.IterateActiveProposalsQueue(ctx, ctx.BlockHeader().Time, func(proposal types.Proposal) bool { | |
| passes, burnDeposits, tallyResults := keeper.Tally(ctx, proposal) | |
| ... | |
| if passes { | |
| handler := keeper.Router().GetRoute(proposal.ProposalRoute()) | |
| cacheCtx, writeCache := ctx.CacheContext() | |
| err := handler(cacheCtx, proposal.GetContent()) | |
| if err == nil { | |
| ... | |
| // write state to the underlying multi-store | |
| writeCache() | |
| } | |
| ... | |
| } | |
| ... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment