-
Notifications
You must be signed in to change notification settings - Fork 40
/
alias.go
59 lines (45 loc) · 2.01 KB
/
alias.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
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
hubtypes "github.com/sentinel-official/hub/types"
nodetypes "github.com/sentinel-official/hub/x/node/types"
plantypes "github.com/sentinel-official/hub/x/plan/types"
subscriptiontypes "github.com/sentinel-official/hub/x/subscription/types"
)
func (k *Keeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI {
return k.account.GetAccount(ctx, addr)
}
func (k *Keeper) SendCoinFromDepositToAccount(ctx sdk.Context, from, to sdk.AccAddress, coin sdk.Coin) error {
if coin.IsZero() {
return nil
}
return k.deposit.SendCoinsFromDepositToAccount(ctx, from, to, sdk.NewCoins(coin))
}
func (k *Keeper) SendCoinFromDepositToModule(ctx sdk.Context, from sdk.AccAddress, to string, coin sdk.Coin) error {
if coin.IsZero() {
return nil
}
return k.deposit.SendCoinsFromDepositToModule(ctx, from, to, sdk.NewCoins(coin))
}
func (k *Keeper) HasNodeForPlan(ctx sdk.Context, id uint64, addr hubtypes.NodeAddress) bool {
return k.node.HasNodeForPlan(ctx, id, addr)
}
func (k *Keeper) GetNode(ctx sdk.Context, addr hubtypes.NodeAddress) (nodetypes.Node, bool) {
return k.node.GetNode(ctx, addr)
}
func (k *Keeper) GetPlan(ctx sdk.Context, id uint64) (plantypes.Plan, bool) {
return k.plan.GetPlan(ctx, id)
}
func (k *Keeper) GetAllocation(ctx sdk.Context, id uint64, addr sdk.AccAddress) (subscriptiontypes.Allocation, bool) {
return k.subscription.GetAllocation(ctx, id, addr)
}
func (k *Keeper) SetAllocation(ctx sdk.Context, alloc subscriptiontypes.Allocation) {
k.subscription.SetAllocation(ctx, alloc)
}
func (k *Keeper) GetLatestPayoutForAccountByNode(ctx sdk.Context, accAddr sdk.AccAddress, nodeAddr hubtypes.NodeAddress) (subscriptiontypes.Payout, bool) {
return k.subscription.GetLatestPayoutForAccountByNode(ctx, accAddr, nodeAddr)
}
func (k *Keeper) GetSubscription(ctx sdk.Context, id uint64) (subscriptiontypes.Subscription, bool) {
return k.subscription.GetSubscription(ctx, id)
}