From 50f1fa0c49d159a685ea47bced8d41da37c81a66 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 22 Jul 2024 11:35:04 +0800 Subject: [PATCH] Problem: versiondb/memiavl don't compatible with upstream sdk (#588) * Problem: versiondb/memiavl don't compatible with upstream sdk Solution: - avoid api breaking change * fix build --- store/cachemulti/store.go | 3 ++- store/rootmulti/store.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 96aafd41e656..16c69ce67841 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -6,6 +6,7 @@ import ( "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" + dbm "github.com/cosmos/cosmos-db" ) // storeNameCtxKey is the TraceContext metadata key that identifies @@ -54,7 +55,7 @@ func NewFromKVStore( // NewStore creates a new Store object from a mapping of store keys to // CacheWrapper objects. Each CacheWrapper store is a branched store. func NewStore( - stores map[types.StoreKey]types.CacheWrapper, + _ dbm.DB, stores map[types.StoreKey]types.CacheWrapper, _ map[string]types.StoreKey, traceWriter io.Writer, traceContext types.TraceContext, ) Store { return NewFromKVStore(stores, traceWriter, traceContext) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 7b811e201ff0..bb3bc04ac4f2 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -565,7 +565,7 @@ func (rs *Store) CacheMultiStore() types.CacheMultiStore { } stores[k] = store } - return cachemulti.NewStore(stores, rs.traceWriter, rs.getTracingContext()) + return cachemulti.NewFromKVStore(stores, rs.traceWriter, rs.getTracingContext()) } // CacheMultiStoreWithVersion is analogous to CacheMultiStore except that it @@ -627,7 +627,7 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor cachedStores[key] = cacheStore } - return cachemulti.NewStore(cachedStores, rs.traceWriter, rs.getTracingContext()), nil + return cachemulti.NewFromKVStore(cachedStores, rs.traceWriter, rs.getTracingContext()), nil } // GetStore returns a mounted Store for a given StoreKey. If the StoreKey does