-
Notifications
You must be signed in to change notification settings - Fork 170
/
keeper.go
63 lines (51 loc) · 1.53 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
package keeper
import (
"fmt"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
"github.com/cometbft/cometbft/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
revtypes "github.com/CosmosContracts/juno/v19/x/feeshare/types"
)
// Keeper of this module maintains collections of feeshares for contracts
// registered to receive transaction fees.
type Keeper struct {
storeKey storetypes.StoreKey
cdc codec.BinaryCodec
bankKeeper revtypes.BankKeeper
wasmKeeper wasmkeeper.Keeper
accountKeeper revtypes.AccountKeeper
feeCollectorName string
// the address capable of executing a MsgUpdateParams message. Typically, this
// should be the x/gov module account.
authority string
}
// NewKeeper creates new instances of the fees Keeper
func NewKeeper(
storeKey storetypes.StoreKey,
cdc codec.BinaryCodec,
bk revtypes.BankKeeper,
wk wasmkeeper.Keeper,
ak revtypes.AccountKeeper,
feeCollector string,
authority string,
) Keeper {
return Keeper{
storeKey: storeKey,
cdc: cdc,
bankKeeper: bk,
wasmKeeper: wk,
accountKeeper: ak,
feeCollectorName: feeCollector,
authority: authority,
}
}
// GetAuthority returns the x/feeshare module's authority.
func (k Keeper) GetAuthority() string {
return k.authority
}
// Logger returns a module-specific logger.
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", revtypes.ModuleName))
}