Merge PR #5622: Track proposal handler events on success

This commit is contained in:
Alexander Bezobchuk
2020-02-06 16:19:26 -05:00
committed by GitHub
parent dba80caec0
commit cd9b2d450b
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -56,6 +56,7 @@ and provided directly the IAVL store.
### Bug Fixes
* (x/gov) [\#5622](https://github.com/cosmos/cosmos-sdk/pull/5622) Track any events emitted from a proposal's handler upon successful execution.
* (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The IAVL `Store#Commit` method has been refactored to
delete a flushed version if it is not a snapshot version. The root multi-store now keeps track of `commitInfo` instead
of `types.CommitID`. During `Commit` of the root multi-store, `lastCommitInfo` is updated from the saved state
+6
View File
@@ -60,6 +60,12 @@ func EndBlocker(ctx sdk.Context, keeper Keeper) {
tagValue = types.AttributeValueProposalPassed
logMsg = "passed"
// The cached context is created with a new EventManager. However, since
// the proposal handler execution was successful, we want to track/keep
// any events emitted, so we re-emit to "merge" the events into the
// original Context's EventManager.
ctx.EventManager().EmitEvents(cacheCtx.EventManager().Events())
// write state to the underlying multi-store
writeCache()
} else {