Skip to content

Commit

Permalink
Problem: versiondb/memiavl don't compatible with upstream sdk (cosmos…
Browse files Browse the repository at this point in the history
…#588)

* Problem: versiondb/memiavl don't compatible with upstream sdk

Solution:
- avoid api breaking change

* fix build

Co-Authored-By: yihuang <[email protected]>
  • Loading branch information
cloudgray and yihuang committed Oct 23, 2024
1 parent 117b111 commit 80e2a8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 3 additions & 1 deletion store/cachemulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,12 +55,13 @@ 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)
}


// NewFromParent constructs a cache multistore with a parent store lazily,
// the parent is usually another cache multistore or the block-stm multiversion store.
func NewFromParent(
Expand Down
5 changes: 2 additions & 3 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -626,8 +626,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
Expand Down

0 comments on commit 80e2a8a

Please sign in to comment.