pub trait RandomnessOps {
// Required methods
fn get_randomness_from_tickets(
&self,
rand_epoch: ChainEpoch,
) -> Result<[u8; 32]>;
fn get_randomness_from_beacon(
&self,
rand_epoch: ChainEpoch,
) -> Result<[u8; 32]>;
}Expand description
Randomness queries.
Required Methods§
Sourcefn get_randomness_from_tickets(
&self,
rand_epoch: ChainEpoch,
) -> Result<[u8; 32]>
fn get_randomness_from_tickets( &self, rand_epoch: ChainEpoch, ) -> Result<[u8; 32]>
Randomness returns a (pseudo)random byte array drawing from the latest ticket chain from a given epoch. This randomness is fork dependant but also biasable because of this.
Sourcefn get_randomness_from_beacon(&self, rand_epoch: ChainEpoch) -> Result<[u8; 32]>
fn get_randomness_from_beacon(&self, rand_epoch: ChainEpoch) -> Result<[u8; 32]>
Randomness returns a (pseudo)random byte array drawing from the latest beacon from a given epoch. This randomness is not tied to any fork of the chain, and is unbiasable.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".