Add GetCommitKVStore and CommitKVStore
This commit is contained in:
parent
53812a2076
commit
7f4bcff3cf
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue