Skip to content

Commit

Permalink
resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Dec 17, 2024
1 parent 8e13d6c commit 1ef617e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions baseapp/baseapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ func (app *BaseApp) MountStores(keys ...storetypes.StoreKey) {
case *storetypes.MemoryStoreKey:
app.MountStore(key, storetypes.StoreTypeMemory)

case *storetypes.ObjectStoreKey:
app.MountStore(key, storetypes.StoreTypeObject)

default:
panic(fmt.Sprintf("Unrecognized store key type :%T", key))
}
Expand Down
7 changes: 7 additions & 0 deletions runtime/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func init() {
ProvideKVStoreFactory,
ProvideTransientStoreKey,
ProvideMemoryStoreKey,
ProvideObjectStoreKey,
ProvideGenesisTxHandler,
ProvideEnvironment,
ProvideTransientStoreService,
Expand Down Expand Up @@ -242,6 +243,12 @@ func ProvideMemoryStoreKey(
return storeKey
}

func ProvideObjectStoreKey(key depinject.ModuleKey, app *AppBuilder) *storetypes.ObjectStoreKey {
storeKey := storetypes.NewObjectStoreKey(fmt.Sprintf("object:%s", key.Name()))
registerStoreKey(app, storeKey)
return storeKey
}

func ProvideModuleManager(modules map[string]appmodule.AppModule) *module.Manager {
return module.NewManagerFromMap(modules)
}
Expand Down
7 changes: 5 additions & 2 deletions store/prefix/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ func (s GStore[V]) CacheWrap() types.CacheWrap {
}

// CacheWrapWithTrace implements the KVStore interface.
func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap {
return cachekv.NewStore(tracekv.NewStore(s, w, tc))
func (s GStore[V]) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap {
if store, ok := any(s).(*GStore[[]byte]); ok {
return cachekv.NewGStore(tracekv.NewStore(store, w, tc), store.isZero, store.valueLen)
}
return s.CacheWrap()
}

// Get implements KVStore
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ replace (
cosmossdk.io/runtime/v2 => ../runtime/v2
cosmossdk.io/server/v2/appmanager => ../server/v2/appmanager
cosmossdk.io/server/v2/stf => ../server/v2/stf
cosmossdk.io/store => ../store
cosmossdk.io/store/v2 => ../store/v2
cosmossdk.io/tools/benchmark => ../tools/benchmark
cosmossdk.io/x/accounts => ../x/accounts
Expand Down Expand Up @@ -285,7 +286,6 @@ replace (
replace (
// We always want to test against the latest version of the simapp.
cosmossdk.io/simapp => ../simapp
cosmossdk.io/store => ../store
github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0
// We always want to test against the latest version of the SDK.
github.com/cosmos/cosmos-sdk => ../.
Expand Down

0 comments on commit 1ef617e

Please sign in to comment.