-
Notifications
You must be signed in to change notification settings - Fork 557
/
keeper.go
68 lines (56 loc) · 1.93 KB
/
keeper.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package keeper
import (
"fmt"
"github.com/cometbft/cometbft/libs/log"
"github.com/osmosis-labs/osmosis/v24/x/superfluid/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
)
// Keeper provides a way to manage module storage.
type Keeper struct {
storeKey storetypes.StoreKey
paramSpace paramtypes.Subspace
ak authkeeper.AccountKeeper
bk types.BankKeeper
sk types.StakingKeeper
ck types.CommunityPoolKeeper
ek types.EpochKeeper
lk types.LockupKeeper
gk types.GammKeeper
ik types.IncentivesKeeper
clk types.ConcentratedKeeper
pmk types.PoolManagerKeeper
vspk types.ValSetPreferenceKeeper
lms types.LockupMsgServer
}
var _ govtypes.StakingKeeper = (*Keeper)(nil)
// NewKeeper returns an instance of Keeper.
func NewKeeper(storeKey storetypes.StoreKey, paramSpace paramtypes.Subspace, ak authkeeper.AccountKeeper, bk types.BankKeeper, sk types.StakingKeeper, dk types.CommunityPoolKeeper, ek types.EpochKeeper, lk types.LockupKeeper, gk types.GammKeeper, ik types.IncentivesKeeper, lms types.LockupMsgServer, clk types.ConcentratedKeeper, pmk types.PoolManagerKeeper, vspk types.ValSetPreferenceKeeper) *Keeper {
// set KeyTable if it has not already been set
if !paramSpace.HasKeyTable() {
paramSpace = paramSpace.WithKeyTable(types.ParamKeyTable())
}
return &Keeper{
storeKey: storeKey,
paramSpace: paramSpace,
ak: ak,
bk: bk,
sk: sk,
ck: dk,
ek: ek,
lk: lk,
gk: gk,
ik: ik,
clk: clk,
pmk: pmk,
vspk: vspk,
lms: lms,
}
}
// Logger returns a logger instance.
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
}