mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-01 08:57:56 +00:00
more clear randomness API for BABE (#8180)
* more clear randomness API for BABE * babe: move randomness utilities to its own file * node: use babe::RandomnessFromOneEpochAgo in random_seed implementation * frame-support: annotate randomness trait with block number * pallet-randomness-collective-flip: fix for new randomness trait * pallet-society: fix randomness usage * pallet-lottery: fix randomness usage * pallet-contracts: fix randomness usage * pallet-babe: fix randomness usage we need to track when the current and previous epoch started so that we know the block number by each existing on-chain was known * node: fix random_seed * node-template: fix random_seed * frame-support: extend docs * babe: add test for epoch starting block number tracking * babe: fix epoch randomness docs * frame: add todos for dealing with randomness api changes Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f3d4355a20
commit
e2960c383e
@@ -740,7 +740,9 @@ where
|
||||
}
|
||||
|
||||
fn random(&self, subject: &[u8]) -> SeedOf<T> {
|
||||
T::Randomness::random(subject)
|
||||
// TODO: change API to expose randomness freshness
|
||||
// https://github.com/paritytech/substrate/issues/8297
|
||||
T::Randomness::random(subject).0
|
||||
}
|
||||
|
||||
fn now(&self) -> &MomentOf<T> {
|
||||
|
||||
Reference in New Issue
Block a user