@@ -43,8 +43,7 @@ package collections
4343
4444import (
4545 " cosmossdk.io/collections"
46- storetypes " cosmossdk.io/store/types"
47- sdk " github.com/cosmos/cosmos-sdk/types"
46+ " cosmossdk.io/core/store"
4847)
4948
5049var AllowListPrefix = collections.NewPrefix (0 )
@@ -54,8 +53,8 @@ type Keeper struct {
5453 AllowList collections.KeySet [string ]
5554}
5655
57- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
58- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
56+ func NewKeeper (storeService store . KVStoreService ) Keeper {
57+ sb := collections.NewSchemaBuilder (storeService )
5958
6059 return Keeper{
6160 AllowList: collections.NewKeySet (sb, AllowListPrefix, " allow_list" , collections.StringKey ),
@@ -168,8 +167,7 @@ package collections
168167
169168import (
170169 " cosmossdk.io/collections"
171- storetypes " cosmossdk.io/store/types"
172- sdk " github.com/cosmos/cosmos-sdk/types"
170+ " cosmossdk.io/core/store"
173171)
174172
175173var IDsPrefix = collections.NewPrefix (0 )
@@ -179,8 +177,8 @@ type Keeper struct {
179177 IDs collections.Map [string , uint64 ]
180178}
181179
182- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
183- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
180+ func NewKeeper (storeService store . KVStoreService ) Keeper {
181+ sb := collections.NewSchemaBuilder (storeService )
184182
185183 return Keeper{
186184 IDs: collections.NewMap (sb, IDsPrefix, " ids" , collections.StringKey , collections.Uint64Value ),
@@ -205,7 +203,7 @@ package collections
205203
206204import (
207205 " cosmossdk.io/collections"
208- storetypes " cosmossdk.io/store/types "
206+ " cosmossdk.io/core/store "
209207 " github.com/cosmos/cosmos-sdk/codec"
210208 sdk " github.com/cosmos/cosmos-sdk/types"
211209 authtypes " github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -218,8 +216,8 @@ type Keeper struct {
218216 Accounts collections.Map [sdk.AccAddress , authtypes.BaseAccount ]
219217}
220218
221- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
222- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
219+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
220+ sb := collections.NewSchemaBuilder (storeService )
223221 return Keeper{
224222 Accounts: collections.NewMap (sb, AccountsPrefix, " accounts" ,
225223 sdk.AccAddressKey , codec.CollValue [authtypes.BaseAccount ](cdc)),
@@ -253,7 +251,7 @@ package collections
253251
254252import (
255253 " cosmossdk.io/collections"
256- storetypes " cosmossdk.io/store/types "
254+ " cosmossdk.io/core/store "
257255 " fmt"
258256 " github.com/cosmos/cosmos-sdk/codec"
259257 sdk " github.com/cosmos/cosmos-sdk/types"
@@ -267,8 +265,8 @@ type Keeper struct {
267265 Accounts collections.Map [sdk.AccAddress , authtypes.BaseAccount ]
268266}
269267
270- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
271- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
268+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
269+ sb := collections.NewSchemaBuilder (storeService )
272270 return Keeper{
273271 Accounts: collections.NewMap (sb, AccountsPrefix, " accounts" ,
274272 sdk.AccAddressKey , codec.CollValue [authtypes.BaseAccount ](cdc)),
@@ -352,7 +350,7 @@ package collections
352350
353351import (
354352 " cosmossdk.io/collections"
355- storetypes " cosmossdk.io/store/types "
353+ " cosmossdk.io/core/store "
356354 " fmt"
357355 sdk " github.com/cosmos/cosmos-sdk/types"
358356)
@@ -364,8 +362,8 @@ type Keeper struct {
364362 ValidatorsSet collections.KeySet [sdk.ValAddress ]
365363}
366364
367- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
368- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
365+ func NewKeeper (storeService store . KVStoreService ) Keeper {
366+ sb := collections.NewSchemaBuilder (storeService )
369367 return Keeper{
370368 ValidatorsSet: collections.NewKeySet (sb, ValidatorsSetPrefix, " validators_set" , sdk.ValAddressKey ),
371369 }
@@ -435,7 +433,7 @@ package collections
435433
436434import (
437435 " cosmossdk.io/collections"
438- storetypes " cosmossdk.io/store/types "
436+ " cosmossdk.io/core/store "
439437 " github.com/cosmos/cosmos-sdk/codec"
440438 sdk " github.com/cosmos/cosmos-sdk/types"
441439 stakingtypes " cosmossdk.io/x/staking/types"
@@ -448,8 +446,8 @@ type Keeper struct {
448446 Params collections.Item [stakingtypes.Params ]
449447}
450448
451- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
452- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
449+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
450+ sb := collections.NewSchemaBuilder (storeService )
453451 return Keeper{
454452 Params: collections.NewItem (sb, ParamsPrefix, " params" , codec.CollValue [stakingtypes.Params ](cdc)),
455453 }
@@ -505,7 +503,7 @@ package collections
505503
506504import (
507505 "cosmossdk.io/collections"
508- storetypes "cosmossdk.io/store/types "
506+ "cosmossdk.io/core/store "
509507 "github.com/cosmos/cosmos-sdk/codec"
510508 sdk "github.com/cosmos/cosmos-sdk/types"
511509 authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -518,8 +516,8 @@ type Keeper struct {
518516 Accounts collections.Map [uint64 , authtypes.BaseAccount ]
519517}
520518
521- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
522- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
519+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
520+ sb := collections.NewSchemaBuilder (storeService )
523521 return Keeper{
524522 Accounts: collections.NewMap (sb, AccountsPrefix, " accounts" , collections.Uint64Key , codec.CollValue [authtypes.BaseAccount ](cdc)),
525523 }
@@ -659,7 +657,7 @@ package collections
659657import (
660658 " cosmossdk.io/collections"
661659 " cosmossdk.io/math"
662- storetypes " cosmossdk.io/store/types "
660+ " cosmossdk.io/core/store "
663661 sdk " github.com/cosmos/cosmos-sdk/types"
664662)
665663
@@ -671,8 +669,8 @@ type Keeper struct {
671669 Balances collections.Map [collections.Pair [sdk.AccAddress , string ], math.Int ]
672670}
673671
674- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
675- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
672+ func NewKeeper (storeService store . KVStoreService ) Keeper {
673+ sb := collections.NewSchemaBuilder (storeService )
676674 return Keeper{
677675 Balances: collections.NewMap (
678676 sb, BalancesPrefix, " balances" ,
@@ -714,8 +712,8 @@ type Keeper struct {
714712 Balances collections.Map [collections.Pair [sdk.AccAddress , string ], math.Int ]
715713}
716714
717- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
718- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
715+ func NewKeeper (storeService store . KVStoreService ) Keeper {
716+ sb := collections.NewSchemaBuilder (storeService )
719717 return Keeper{
720718 Balances: collections.NewMap (
721719 sb, BalancesPrefix, " balances" ,
@@ -901,8 +899,8 @@ type Keeper struct {
901899 Accounts *collections.IndexedMap [sdk.AccAddress , authtypes.BaseAccount , AccountsIndexes ]
902900}
903901
904- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
905- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
902+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
903+ sb := collections.NewSchemaBuilder (storeService )
906904 return Keeper{
907905 Accounts: collections.NewIndexedMap (
908906 sb, AccountsPrefix, " accounts" ,
@@ -927,7 +925,7 @@ package docs
927925import (
928926 " cosmossdk.io/collections"
929927 " cosmossdk.io/collections/indexes"
930- storetypes " cosmossdk.io/store/types "
928+ " cosmossdk.io/core/store "
931929 " github.com/cosmos/cosmos-sdk/codec"
932930 sdk " github.com/cosmos/cosmos-sdk/types"
933931 authtypes " github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -962,8 +960,8 @@ type Keeper struct {
962960 Accounts *collections.IndexedMap [sdk.AccAddress , authtypes.BaseAccount , AccountsIndexes ]
963961}
964962
965- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
966- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
963+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
964+ sb := collections.NewSchemaBuilder (storeService )
967965 return Keeper{
968966 Accounts: collections.NewIndexedMap (
969967 sb, AccountsPrefix, " accounts" ,
@@ -986,7 +984,7 @@ package docs
986984import (
987985 " cosmossdk.io/collections"
988986 " cosmossdk.io/collections/indexes"
989- storetypes " cosmossdk.io/store/types "
987+ " cosmossdk.io/core/store "
990988 " github.com/cosmos/cosmos-sdk/codec"
991989 sdk " github.com/cosmos/cosmos-sdk/types"
992990 authtypes " github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -1021,8 +1019,8 @@ type Keeper struct {
10211019 Accounts *collections.IndexedMap [sdk.AccAddress , authtypes.BaseAccount , AccountsIndexes ]
10221020}
10231021
1024- func NewKeeper (storeKey * storetypes . KVStoreKey , cdc codec .BinaryCodec ) Keeper {
1025- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
1022+ func NewKeeper (storeService store . KVStoreService , cdc codec .BinaryCodec ) Keeper {
1023+ sb := collections.NewSchemaBuilder (storeService )
10261024 return Keeper{
10271025 Accounts: collections.NewIndexedMap (
10281026 sb, AccountsPrefix, " accounts" ,
@@ -1094,7 +1092,7 @@ package example
10941092
10951093import (
10961094 " cosmossdk.io/collections"
1097- storetypes " cosmossdk.io/store/types "
1095+ " cosmossdk.io/core/store "
10981096 " github.com/cosmos/cosmos-sdk/codec"
10991097 sdk " github.com/cosmos/cosmos-sdk/types"
11001098 authtypes " github.com/cosmos/cosmos-sdk/x/auth/types"
@@ -1107,8 +1105,8 @@ type Keeper struct {
11071105 Accounts *collections.Map [sdk.AccAddress , sdk.AccountI ]
11081106}
11091107
1110- func NewKeeper (cdc codec .BinaryCodec , storeKey * storetypes . KVStoreKey ) Keeper {
1111- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
1108+ func NewKeeper (cdc codec .BinaryCodec , storeService store . KVStoreService ) Keeper {
1109+ sb := collections.NewSchemaBuilder (storeService )
11121110 return Keeper{
11131111 Accounts: collections.NewMap (
11141112 sb, AccountsPrefix, " accounts" ,
@@ -1143,8 +1141,7 @@ import (
11431141 " context"
11441142
11451143 " cosmossdk.io/collections"
1146- storetypes " cosmossdk.io/store/types"
1147- " github.com/cosmos/cosmos-sdk/codec"
1144+ " cosmossdk.io/core/store"
11481145)
11491146
11501147type AccAddress = string
@@ -1156,8 +1153,8 @@ type Keeper struct {
11561153 Redelegations collections.KeySet [collections.Triple [AccAddress, ValAddress , ValAddress ]]
11571154}
11581155
1159- func NewKeeper (storeKey * storetypes . KVStoreKey ) Keeper {
1160- sb := collections.NewSchemaBuilder (sdk. OpenKVStore (storeKey) )
1156+ func NewKeeper (storeService store . KVStoreService ) Keeper {
1157+ sb := collections.NewSchemaBuilder (storeService )
11611158 return Keeper{
11621159 Redelegations: collections.NewKeySet (sb, collections.NewPrefix (0 ), " redelegations" , collections.TripleKeyCodec (collections.StringKey , collections.StringKey , collections.StringKey )
11631160 }
0 commit comments