Skip to content

Commit b09d61e

Browse files
committed
Apply suggestions from code review
1 parent 69d1149 commit b09d61e

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

baseapp/baseapp.go

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ import (
44
"context"
55
"errors"
66
"fmt"
7+
"maps"
78
"math"
8-
"sort"
9+
"slices"
910
"strconv"
1011
"sync"
1112

1213
abci "github.com/cometbft/cometbft/api/cometbft/abci/v1"
1314
cmtproto "github.com/cometbft/cometbft/api/cometbft/types/v1"
1415
"github.com/cometbft/cometbft/crypto/tmhash"
1516
"github.com/cosmos/gogoproto/proto"
16-
"golang.org/x/exp/maps"
1717
"google.golang.org/protobuf/reflect/protoreflect"
1818

1919
"cosmossdk.io/core/header"
@@ -336,8 +336,7 @@ func (app *BaseApp) MountTransientStores(keys map[string]*storetypes.TransientSt
336336
// MountMemoryStores mounts all in-memory KVStores with the BaseApp's internal
337337
// commit multi-store.
338338
func (app *BaseApp) MountMemoryStores(keys map[string]*storetypes.MemoryStoreKey) {
339-
skeys := maps.Keys(keys)
340-
sort.Strings(skeys)
339+
skeys := slices.Sorted(maps.Keys(keys))
341340
for _, key := range skeys {
342341
memKey := keys[key]
343342
app.MountStore(memKey, storetypes.StoreTypeMemory)
@@ -347,8 +346,7 @@ func (app *BaseApp) MountMemoryStores(keys map[string]*storetypes.MemoryStoreKey
347346
// MountObjectStores mounts all transient object stores with the BaseApp's internal
348347
// commit multi-store.
349348
func (app *BaseApp) MountObjectStores(keys map[string]*storetypes.ObjectStoreKey) {
350-
skeys := maps.Keys(keys)
351-
sort.Strings(skeys)
349+
skeys := slices.Sorted(maps.Keys(keys))
352350
for _, key := range skeys {
353351
memKey := keys[key]
354352
app.MountStore(memKey, storetypes.StoreTypeObject)

store/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3131
3232
## [Unreleased]
3333

34+
### Features
35+
36+
* [#22893](https://github.com/cosmos/cosmos-sdk/pull/22893) Support mount object store in baseapp, add `ObjectStore` api in context.
37+
3438
## v1.10.0 (December 13, 2024)
3539

3640
### Improvements

0 commit comments

Comments
 (0)