Trait forest_filecoin::beacon::drand::Beacon

source ·
pub trait Beacon
where Self: Send + Sync + 'static,
{ // Required methods fn network(&self) -> DrandNetwork; fn verify_entries( &self, entries: &[BeaconEntry], prev: &BeaconEntry, ) -> Result<bool, Error>; fn entry<'life0, 'async_trait>( &'life0 self, round: u64, ) -> Pin<Box<dyn Future<Output = Result<BeaconEntry>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn max_beacon_round_for_epoch( &self, network_version: NetworkVersion, fil_epoch: i64, ) -> u64; }
Expand description

Trait used as the interface to be able to retrieve bytes from a randomness beacon.

Required Methods§

source

fn network(&self) -> DrandNetwork

Gets the drand network

source

fn verify_entries( &self, entries: &[BeaconEntry], prev: &BeaconEntry, ) -> Result<bool, Error>

Verify beacon entries that are sorted by round.

source

fn entry<'life0, 'async_trait>( &'life0 self, round: u64, ) -> Pin<Box<dyn Future<Output = Result<BeaconEntry>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a BeaconEntry given a round. It fetches the BeaconEntry from a Drand node over gRPC In the future, we will cache values, and support streaming.

source

fn max_beacon_round_for_epoch( &self, network_version: NetworkVersion, fil_epoch: i64, ) -> u64

Returns the most recent beacon round for the given Filecoin chain epoch.

Trait Implementations§

source§

impl Beacon for Box<dyn Beacon>

source§

fn network(&self) -> DrandNetwork

Gets the drand network
source§

fn verify_entries( &self, entries: &[BeaconEntry], prev: &BeaconEntry, ) -> Result<bool, Error>

Verify beacon entries that are sorted by round.
source§

fn entry<'life0, 'async_trait>( &'life0 self, round: u64, ) -> Pin<Box<dyn Future<Output = Result<BeaconEntry, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns a BeaconEntry given a round. It fetches the BeaconEntry from a Drand node over gRPC In the future, we will cache values, and support streaming.
source§

fn max_beacon_round_for_epoch( &self, network_version: NetworkVersion, fil_epoch: i64, ) -> u64

Returns the most recent beacon round for the given Filecoin chain epoch.

Implementations on Foreign Types§

source§

impl Beacon for Box<dyn Beacon>

source§

fn network(&self) -> DrandNetwork

source§

fn verify_entries( &self, entries: &[BeaconEntry], prev: &BeaconEntry, ) -> Result<bool, Error>

source§

fn entry<'life0, 'async_trait>( &'life0 self, round: u64, ) -> Pin<Box<dyn Future<Output = Result<BeaconEntry, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source§

fn max_beacon_round_for_epoch( &self, network_version: NetworkVersion, fil_epoch: i64, ) -> u64

Implementors§