From 0bcc7c9b7aa6fa6b0b6aa86802f0112d04e7ea4c Mon Sep 17 00:00:00 2001 From: Alexander Bezobchuk Date: Thu, 8 Aug 2019 12:32:05 -0400 Subject: [PATCH] Merge PR #4873: Set New EventManager in Context#CacheContext --- .pending/bugfixes/_4868-Context-CacheC | 2 ++ types/context.go | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .pending/bugfixes/_4868-Context-CacheC diff --git a/.pending/bugfixes/_4868-Context-CacheC b/.pending/bugfixes/_4868-Context-CacheC new file mode 100644 index 0000000000..84b0f63407 --- /dev/null +++ b/.pending/bugfixes/_4868-Context-CacheC @@ -0,0 +1,2 @@ +#4868 Context#CacheContext now sets a new EventManager. This prevents unwanted events +from being emitted. diff --git a/types/context.go b/types/context.go index ef2a2e7530..9fe8f2b674 100644 --- a/types/context.go +++ b/types/context.go @@ -205,10 +205,11 @@ func (c Context) TransientStore(key StoreKey) KVStore { return gaskv.NewStore(c.MultiStore().GetKVStore(key), c.GasMeter(), stypes.TransientGasConfig()) } -// Cache the multistore and return a new cached context. The cached context is -// written to the context when writeCache is called. +// CacheContext returns a new Context with the multi-store cached and a new +// EventManager. The cached context is written to the context when writeCache +// is called. func (c Context) CacheContext() (cc Context, writeCache func()) { cms := c.MultiStore().CacheMultiStore() - cc = c.WithMultiStore(cms) + cc = c.WithMultiStore(cms).WithEventManager(NewEventManager()) return cc, cms.Write }