-
Notifications
You must be signed in to change notification settings - Fork 90
/
blocktime.go
34 lines (30 loc) · 1021 Bytes
/
blocktime.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
package keeper
import (
tmdb "github.com/cometbft/cometbft-db"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
"github.com/dydxprotocol/v4-chain/protocol/x/blocktime/keeper"
"github.com/dydxprotocol/v4-chain/protocol/x/blocktime/types"
delaymsgtypes "github.com/dydxprotocol/v4-chain/protocol/x/delaymsg/types"
)
func createBlockTimeKeeper(
stateStore storetypes.CommitMultiStore,
db *tmdb.MemDB,
cdc *codec.ProtoCodec,
) (*keeper.Keeper, storetypes.StoreKey) {
storeKey := sdk.NewKVStoreKey(types.StoreKey)
stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db)
authorities := []string{
authtypes.NewModuleAddress(delaymsgtypes.ModuleName).String(),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
}
k := keeper.NewKeeper(
cdc,
storeKey,
authorities,
)
return k, storeKey
}