Struct chain_impl_mockchain::leadership::genesis::vrfeval::VrfEvaluator
source · pub struct VrfEvaluator<'a> {
pub stake: PercentStake,
pub nonce: &'a PraosNonce,
pub slot_id: SlotId,
pub active_slots_coeff: ActiveSlotsCoeff,
}
Fields§
§stake: PercentStake
§nonce: &'a PraosNonce
§slot_id: SlotId
§active_slots_coeff: ActiveSlotsCoeff
Implementations§
source§impl<'a> VrfEvaluator<'a>
impl<'a> VrfEvaluator<'a>
sourcepub fn evaluate(
&self,
key: &SecretKey<RistrettoGroup2HashDh>
) -> Option<Witness>
pub fn evaluate( &self, key: &SecretKey<RistrettoGroup2HashDh> ) -> Option<Witness>
Evaluate if the threshold is above for a given input for the key and the associated stake
On threshold success, the witness is returned, otherwise None is returned
sourcepub fn verify(
&self,
key: &PublicKey<RistrettoGroup2HashDh>,
witness: &'a Witness
) -> Result<PraosNonce, VrfEvalFailure>
pub fn verify( &self, key: &PublicKey<RistrettoGroup2HashDh>, witness: &'a Witness ) -> Result<PraosNonce, VrfEvalFailure>
verify that the witness pass the threshold for this witness for a given key and its associated stake.
On success, the nonce is returned, otherwise None is returned
Auto Trait Implementations§
impl<'a> RefUnwindSafe for VrfEvaluator<'a>
impl<'a> Send for VrfEvaluator<'a>
impl<'a> Sync for VrfEvaluator<'a>
impl<'a> Unpin for VrfEvaluator<'a>
impl<'a> UnwindSafe for VrfEvaluator<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more