cachecontext comments and changelog update
This commit is contained in:
parent
1c8094c6bd
commit
bdc7fe56ba
|
@ -7,6 +7,10 @@ BREAKING CHANGES
|
|||
* Remove go-wire, use go-amino
|
||||
* [store] Add `SubspaceIterator` and `ReverseSubspaceIterator` to `KVStore` interface
|
||||
|
||||
FEATURES:
|
||||
|
||||
* Add CacheContext
|
||||
|
||||
## 0.14.1 (April 9, 2018)
|
||||
|
||||
BUG FIXES
|
||||
|
|
|
@ -22,7 +22,6 @@ next decorator or handler. For example,
|
|||
...
|
||||
}
|
||||
*/
|
||||
|
||||
type Context struct {
|
||||
context.Context
|
||||
pst *thePast
|
||||
|
@ -172,9 +171,11 @@ func (c Context) WithTxBytes(txBytes []byte) Context {
|
|||
return c.withValue(contextKeyTxBytes, txBytes)
|
||||
}
|
||||
|
||||
func (c Context) CacheContext() (Context, func()) {
|
||||
// Cache the multistore and return a new cached context. 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)
|
||||
return cc, cms.Write
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue