From 4333b1991888816dcb849d4eb25b269b910f254d Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Thu, 6 Feb 2020 16:19:26 -0500 Subject: [PATCH] Merge PR #5622: Track proposal handler events on success --- CHANGELOG.md | 1 + x/gov/endblocker.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ebef32a674..0a2b8eb0ee88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ respectively. ### 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. * (x/bank) [\#5531](https://github.com/cosmos/cosmos-sdk/issues/5531) Added missing amount event to MsgMultiSend, emitted for each output. ## [v0.37.6] - 2020-01-21 diff --git a/x/gov/endblocker.go b/x/gov/endblocker.go index d9d7933e05bd..d2b8ee03d4ec 100644 --- a/x/gov/endblocker.go +++ b/x/gov/endblocker.go @@ -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 {