Merge PR #4997: Fix CacheMultiStoreWithVersion (inter-block cache)

This commit is contained in:
Alexander Bezobchuk
2019-09-05 12:29:00 -04:00
committed by GitHub
parent d7d7a93729
commit 2d18f1e7e9
4 changed files with 32 additions and 0 deletions
+9
View File
@@ -70,6 +70,15 @@ func (cmgr *CommitKVStoreCacheManager) GetStoreCache(key types.StoreKey, store t
return cmgr.caches[key.Name()]
}
// Unwrap returns the underlying CommitKVStore for a given StoreKey.
func (cmgr *CommitKVStoreCacheManager) Unwrap(key types.StoreKey) types.CommitKVStore {
if ckv, ok := cmgr.caches[key.Name()]; ok {
return ckv.(*CommitKVStoreCache).CommitKVStore
}
return nil
}
// Reset resets in the internal caches.
func (cmgr *CommitKVStoreCacheManager) Reset() {
cmgr.caches = make(map[string]types.CommitKVStore)