Merge PR #4873: Set New EventManager in Context#CacheContext
This commit is contained in:
parent
1dfbfc08d7
commit
0bcc7c9b7a
|
@ -0,0 +1,2 @@
|
|||
#4868 Context#CacheContext now sets a new EventManager. This prevents unwanted events
|
||||
from being emitted.
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue