diff --git a/CHANGELOG.md b/CHANGELOG.md index a213f90b41..b8f6ccdfe8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/store/rootmultistore.go b/store/rootmultistore.go index 5b1307c104..a39c35813f 100644 --- a/store/rootmultistore.go +++ b/store/rootmultistore.go @@ -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) diff --git a/store/types.go b/store/types.go index ec842d9cf8..fa27e94dad 100644 --- a/store/types.go +++ b/store/types.go @@ -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 diff --git a/types/store.go b/types/store.go index b552f8cb02..ef2e9154b6 100644 --- a/types/store.go +++ b/types/store.go @@ -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