Skip to content

Commit

Permalink
chore: Sync with cronos memiavl store version
Browse files Browse the repository at this point in the history
  • Loading branch information
dudong2 committed Oct 17, 2024
1 parent 364149d commit eefcddf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
11 changes: 11 additions & 0 deletions store/cachemulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"fmt"
"io"

dbm "github.com/cosmos/cosmos-db"

"cosmossdk.io/store/tracekv"
"cosmossdk.io/store/types"
)
Expand Down Expand Up @@ -54,6 +56,15 @@ 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(
_ dbm.DB, stores map[types.StoreKey]types.CacheWrapper, _ map[string]types.StoreKey,
traceWriter io.Writer, traceContext types.TraceContext,
) Store {
return newStore(stores, traceWriter, traceContext)
}

// 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,
traceWriter io.Writer, traceContext types.TraceContext,
) Store {
Expand Down
4 changes: 2 additions & 2 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.NewStore(nil, stores, nil, rs.traceWriter, rs.getTracingContext())
}

// CacheMultiStoreWithVersion is analogous to CacheMultiStore except that it
Expand Down Expand Up @@ -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.NewStore(nil, cachedStores, nil, rs.traceWriter, rs.getTracingContext()), nil
}

// GetStore returns a mounted Store for a given StoreKey. If the StoreKey does
Expand Down

0 comments on commit eefcddf

Please sign in to comment.