File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ package chain
2
+
3
+ import (
4
+ "context"
5
+
6
+ "github.com/filecoin-project/go-state-types/abi"
7
+ v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1"
8
+ "github.com/filecoin-project/venus/venus-shared/types"
9
+ )
10
+
11
+ var _ v1api.IBeacon = & beaconAPI {}
12
+
13
+ type beaconAPI struct {
14
+ chain * ChainSubmodule
15
+ }
16
+
17
+ //NewBeaconAPI create a new beacon api
18
+ func NewBeaconAPI (chain * ChainSubmodule ) v1api.IBeacon {
19
+ return & beaconAPI {chain : chain }
20
+ }
21
+
22
+ // BeaconGetEntry returns the beacon entry for the given filecoin epoch. If
23
+ // the entry has not yet been produced, the call will block until the entry
24
+ // becomes available
25
+ func (beaconAPI * beaconAPI ) BeaconGetEntry (ctx context.Context , epoch abi.ChainEpoch ) (* types.BeaconEntry , error ) {
26
+ return beaconAPI .chain .API ().StateGetBeaconEntry (ctx , epoch )
27
+ }
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ func (chain *ChainSubmodule) API() v1api.IChain {
113
113
IActor : NewActorAPI (chain ),
114
114
IChainInfo : NewChainInfoAPI (chain ),
115
115
IMinerState : NewMinerStateAPI (chain ),
116
+ IBeacon : NewBeaconAPI (chain ),
116
117
}
117
118
}
118
119
You can’t perform that action at this time.
0 commit comments