mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 15:47:58 +00:00
babe: make secondary slot randomness available on-chain (#7053)
* babe: make secondary slot randomness available on-chain * babe: extract out vrf_output function * babe: add missing comment * babe: fix incorrectly storing primary randomness * babe: add test for onchain author vrf * babe: fix reviewer nits * runtime: bump spec_version * babe: remove outer Option for AuthorVrfRandomness * babe: fix reviewer nits on doc strings * babe: move make_vrf_output to mock.rs * babe: cleanup docs * babe: kill ephemeral entry instead of take * babe: use type alias for maybe randomness Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
@@ -110,6 +110,15 @@ impl PreDigest {
|
||||
PreDigest::SecondaryPlain(_) | PreDigest::SecondaryVRF(_) => 0,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the VRF output, if it exists.
|
||||
pub fn vrf_output(&self) -> Option<&VRFOutput> {
|
||||
match self {
|
||||
PreDigest::Primary(primary) => Some(&primary.vrf_output),
|
||||
PreDigest::SecondaryVRF(secondary) => Some(&secondary.vrf_output),
|
||||
PreDigest::SecondaryPlain(_) => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Information about the next epoch. This is broadcast in the first block
|
||||
|
||||
Reference in New Issue
Block a user