-
Notifications
You must be signed in to change notification settings - Fork 462
/
cache.go
39 lines (30 loc) · 1.19 KB
/
cache.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
package events
import (
"context"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/ipfs/go-cid"
"github.com/filecoin-project/venus/venus-shared/types"
)
type uncachedAPI interface {
ChainNotify(context.Context) (<-chan []*types.HeadChange, error)
ChainGetPath(ctx context.Context, from, to types.TipSetKey) ([]*types.HeadChange, error)
StateSearchMsg(ctx context.Context, from types.TipSetKey, msg cid.Cid, limit abi.ChainEpoch, allowReplaced bool) (*types.MsgLookup, error)
StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error) // optional / for CalledMsg
ChainGetTipSetAfterHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)
ChainHead(context.Context) (*types.TipSet, error)
}
type cache struct {
//*tipSetCache
*messageCache
uncachedAPI
}
func newCache(api IEvent, gcConfidence abi.ChainEpoch) *cache {
return &cache{
// newTSCache(api, gcConfidence),
newMessageCache(api),
api,
}
}