-
Notifications
You must be signed in to change notification settings - Fork 83
/
alloc.go
42 lines (36 loc) · 1.32 KB
/
alloc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package keeper
// import (
// "testing"
// "github.com/cosmos/cosmos-sdk/codec"
// codectypes "github.com/cosmos/cosmos-sdk/codec/types"
// "github.com/cosmos/cosmos-sdk/store"
// storetypes "github.com/cosmos/cosmos-sdk/store/types"
// sdk "github.com/cosmos/cosmos-sdk/types"
// "github.com/public-awesome/stargaze/x/alloc/keeper"
// "github.com/public-awesome/stargaze/x/alloc/types"
// "github.com/stretchr/testify/require"
// "github.com/cometbft/cometbft/libs/log"
// tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
// tmdb "github.com/cometbft/cometbft-db"
// )
// func AllocKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) {
// storeKey := sdk.NewKVStoreKey(types.StoreKey)
// memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey)
// db := tmdb.NewMemDB()
// stateStore := store.NewCommitMultiStore(db)
// stateStore.MountStoreWithDB(storeKey, sdk.StoreTypeIAVL, db)
// stateStore.MountStoreWithDB(memStoreKey, sdk.StoreTypeMemory, nil)
// require.NoError(t, stateStore.LoadLatestVersion())
// registry := codectypes.NewInterfaceRegistry()
// k := keeper.NewKeeper(
// codec.NewProtoCodec(registry),
// storeKey,
// memStoreKey,
// nil,
// nil,
// nil,
// nil,
// )
// ctx := sdk.NewContext(stateStore, tmproto.Header{}, false, log.NewNopLogger())
// return k, ctx
// }