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 }