Skip to content

Commit

Permalink
fix!: remove duplicate event emission (#2282)
Browse files Browse the repository at this point in the history
* remove duplicate event emission

* add changelog entry

(cherry picked from commit 47b786a)

# Conflicts:
#	x/ccv/provider/keeper/consumer_lifecycle.go
  • Loading branch information
mpoke authored and mergify[bot] committed Sep 20, 2024
1 parent 5eb6d8c commit db91a40
Show file tree
Hide file tree
Showing 3 changed files with 664 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/bug-fixes/2282-duplicate-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Remove duplicate event emission on cached context.
([\#2282](https://github.com/cosmos/interchain-security/pull/2282))
3 changes: 0 additions & 3 deletions x/ccv/consumer/keeper/distribution.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ func (k Keeper) EndBlockRD(ctx sdk.Context) {
if err := k.SendRewardsToProvider(cachedCtx); err != nil {
k.Logger(ctx).Error("attempt to sent rewards to provider failed", "error", err)
} else {
// The cached context is created with a new EventManager so we merge the event
// into the original context
ctx.EventManager().EmitEvents(cachedCtx.EventManager().Events())
// write cache
writeCache()
}
Expand Down
Loading

0 comments on commit db91a40

Please sign in to comment.