-
Notifications
You must be signed in to change notification settings - Fork 203
/
keeper.go
35 lines (30 loc) · 1.14 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
package keeper
import (
"github.com/cosmos/cosmos-sdk/codec"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/lavanet/lava/x/fixationstore/types"
timerstorekeeper "github.com/lavanet/lava/x/timerstore/keeper"
)
func NewKeeper(cdc codec.BinaryCodec, tsKeeper *timerstorekeeper.Keeper, getStaleBlocks types.GetStaleBlocks) *Keeper {
return &Keeper{
cdc: cdc,
ts: tsKeeper,
getStaleBlocks: getStaleBlocks,
}
}
// Keeper is the fixationstore keeper. The keeper retains all the fixation stores used by modules,
// it also manages their lifecycle.
type Keeper struct {
fixationsStores []*types.FixationStore
ts *timerstorekeeper.Keeper
cdc codec.BinaryCodec
getStaleBlocks types.GetStaleBlocks
}
func (k *Keeper) NewFixationStore(storeKey storetypes.StoreKey, prefix string) *types.FixationStore {
ts := k.ts.NewTimerStoreBeginBlock(storeKey, prefix)
fs := types.NewFixationStore(storeKey, k.cdc, prefix, ts, k.getStaleBlocks)
k.fixationsStores = append(k.fixationsStores, fs)
return fs
}
func (k *Keeper) BeginBlock(ctx sdk.Context) {}