-
Notifications
You must be signed in to change notification settings - Fork 0
/
keeper.go
42 lines (34 loc) · 1.52 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
package keeper
import (
"fmt"
"github.com/furyaxyz/fuxchain/libs/cosmos-sdk/codec"
storetypes "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/store/types"
sdk "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/types"
capabilitykeeper "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/furyaxyz/fuxchain/libs/cosmos-sdk/x/capability/types"
icacontrollerkeeper "github.com/furyaxyz/fuxchain/libs/ibc-go/modules/apps/27-interchain-accounts/controller/keeper"
"github.com/furyaxyz/fuxchain/libs/tendermint/libs/log"
"github.com/furyaxyz/fuxchain/x/icamauth/types"
)
type Keeper struct {
cdc *codec.CodecProxy
storeKey storetypes.StoreKey
scopedKeeper capabilitykeeper.ScopedKeeper
icaControllerKeeper icacontrollerkeeper.Keeper
}
func NewKeeper(cdc *codec.CodecProxy, storeKey storetypes.StoreKey, iaKeeper icacontrollerkeeper.Keeper, scopedKeeper capabilitykeeper.ScopedKeeper) Keeper {
return Keeper{
cdc: cdc,
storeKey: storeKey,
scopedKeeper: scopedKeeper,
icaControllerKeeper: iaKeeper,
}
}
// Logger returns the application logger, scoped to the associated module
func (k Keeper) Logger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName))
}
// ClaimCapability claims the channel capability passed via the OnOpenChanInit callback
func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error {
return k.scopedKeeper.ClaimCapability(ctx, cap, name)
}