-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: impl api BeaconGetEntry (#4989)
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package chain | ||
|
||
import ( | ||
"context" | ||
|
||
"github.com/filecoin-project/go-state-types/abi" | ||
v1api "github.com/filecoin-project/venus/venus-shared/api/chain/v1" | ||
"github.com/filecoin-project/venus/venus-shared/types" | ||
) | ||
|
||
var _ v1api.IBeacon = &beaconAPI{} | ||
|
||
type beaconAPI struct { | ||
chain *ChainSubmodule | ||
} | ||
|
||
//NewBeaconAPI create a new beacon api | ||
func NewBeaconAPI(chain *ChainSubmodule) v1api.IBeacon { | ||
return &beaconAPI{chain: chain} | ||
} | ||
|
||
// BeaconGetEntry returns the beacon entry for the given filecoin epoch. If | ||
// the entry has not yet been produced, the call will block until the entry | ||
// becomes available | ||
func (beaconAPI *beaconAPI) BeaconGetEntry(ctx context.Context, epoch abi.ChainEpoch) (*types.BeaconEntry, error) { | ||
return beaconAPI.chain.API().StateGetBeaconEntry(ctx, epoch) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters