|
1 | 1 | package keeper |
2 | 2 |
|
3 | 3 | import ( |
| 4 | + "time" |
| 5 | + |
4 | 6 | sdk "github.com/cosmos/cosmos-sdk/types" |
5 | 7 |
|
6 | 8 | base "github.com/sentinel-official/hub/v12/types" |
| 9 | + sessiontypes "github.com/sentinel-official/hub/v12/x/session/types/v3" |
7 | 10 | ) |
8 | 11 |
|
9 | 12 | func (k *Keeper) FundCommunityPool(ctx sdk.Context, fromAddr sdk.AccAddress, coin sdk.Coin) error { |
@@ -46,6 +49,50 @@ func (k *Keeper) SubtractDeposit(ctx sdk.Context, addr sdk.AccAddress, coin sdk. |
46 | 49 | return k.deposit.SubtractDeposit(ctx, addr, sdk.NewCoins(coin)) |
47 | 50 | } |
48 | 51 |
|
| 52 | +func (k *Keeper) DeleteSession(ctx sdk.Context, id uint64) { |
| 53 | + k.session.DeleteSession(ctx, id) |
| 54 | +} |
| 55 | + |
| 56 | +func (k *Keeper) DeleteSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64) { |
| 57 | + k.session.DeleteSessionForAccount(ctx, addr, id) |
| 58 | +} |
| 59 | + |
| 60 | +func (k *Keeper) DeleteSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64) { |
| 61 | + k.session.DeleteSessionForNode(ctx, addr, id) |
| 62 | +} |
| 63 | + |
| 64 | +func (k *Keeper) GetSessionCount(ctx sdk.Context) uint64 { |
| 65 | + return k.session.GetCount(ctx) |
| 66 | +} |
| 67 | + |
| 68 | +func (k *Keeper) GetSession(ctx sdk.Context, id uint64) (sessiontypes.Session, bool) { |
| 69 | + return k.session.GetSession(ctx, id) |
| 70 | +} |
| 71 | + |
| 72 | +func (k *Keeper) SetSessionCount(ctx sdk.Context, count uint64) { |
| 73 | + k.session.SetCount(ctx, count) |
| 74 | +} |
| 75 | + |
| 76 | +func (k *Keeper) SetSession(ctx sdk.Context, session sessiontypes.Session) { |
| 77 | + k.session.SetSession(ctx, session) |
| 78 | +} |
| 79 | + |
| 80 | +func (k *Keeper) SetSessionForAccount(ctx sdk.Context, addr sdk.AccAddress, id uint64) { |
| 81 | + k.session.SetSessionForAccount(ctx, addr, id) |
| 82 | +} |
| 83 | + |
| 84 | +func (k *Keeper) SetSessionForInactiveAt(ctx sdk.Context, at time.Time, id uint64) { |
| 85 | + k.session.SetSessionForInactiveAt(ctx, at, id) |
| 86 | +} |
| 87 | + |
| 88 | +func (k *Keeper) SetSessionForNode(ctx sdk.Context, addr base.NodeAddress, id uint64) { |
| 89 | + k.session.SetSessionForNode(ctx, addr, id) |
| 90 | +} |
| 91 | + |
| 92 | +func (k *Keeper) SessionStatusChangeDelay(ctx sdk.Context) time.Duration { |
| 93 | + return k.session.StatusChangeDelay(ctx) |
| 94 | +} |
| 95 | + |
49 | 96 | func (k *Keeper) NodeInactivePreHook(ctx sdk.Context, addr base.NodeAddress) error { |
50 | 97 | if err := k.lease.NodeInactivePreHook(ctx, addr); err != nil { |
51 | 98 | return err |
|
0 commit comments