Merge pull request #499 from cosmos/feature/get-commit-kv-store

REVIEW: Add GetCommitKVStore and CommitKVStore
This commit is contained in:
Ethan Buchman
2018-02-27 19:27:53 -05:00
committed by GitHub
4 changed files with 24 additions and 2 deletions
+7
View File
@@ -1,5 +1,12 @@
# Changelog
## 0.11.0 (TBD)
BREAKING CHANGES
* [examples] dummy -> kvstore
* [types] CommitMultiStore interface has new `GetCommitKVStore(key StoreKey) CommitKVStore` method
## 0.10.0 (February 20, 2017)
BREAKING CHANGES
+5
View File
@@ -67,6 +67,11 @@ func (rs *rootMultiStore) GetCommitStore(key StoreKey) CommitStore {
return rs.stores[key]
}
// Implements CommitMultiStore.
func (rs *rootMultiStore) GetCommitKVStore(key StoreKey) CommitKVStore {
return rs.stores[key].(CommitKVStore)
}
// Implements CommitMultiStore.
func (rs *rootMultiStore) LoadLatestVersion() error {
ver := getLatestVersion(rs.db)
+3 -2
View File
@@ -6,14 +6,15 @@ import (
// Import cosmos-sdk/types/store.go for convenience.
type Store = types.Store
type Committer = types.Committer
type CommitStore = types.CommitStore
type MultiStore = types.MultiStore
type CacheMultiStore = types.CacheMultiStore
type CommitStore = types.CommitStore
type Committer = types.Committer
type CommitMultiStore = types.CommitMultiStore
type KVStore = types.KVStore
type Iterator = types.Iterator
type CacheKVStore = types.CacheKVStore
type CommitKVStore = types.CommitKVStore
type CacheWrapper = types.CacheWrapper
type CacheWrap = types.CacheWrap
type CommitID = types.CommitID
+9
View File
@@ -68,6 +68,9 @@ type CommitMultiStore interface {
// Panics on a nil key.
GetCommitStore(key StoreKey) CommitStore
// Panics on a nil key.
GetCommitKVStore(key StoreKey) CommitKVStore
// Load the latest persisted version. Called once after all
// calls to Mount*Store() are complete.
LoadLatestVersion() error
@@ -129,6 +132,12 @@ type CacheKVStore interface {
Write()
}
// Stores of MultiStore must implement CommitStore.
type CommitKVStore interface {
Committer
KVStore
}
//----------------------------------------
// CacheWrap