You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
It's only used in frame/society/src/mock.rs which lives behind #[cfg(test)] mod mock; so maybe it can be replaced by pallet-randomness-collective-flip which provides insecure randomness for tests elsewhere?
If we want this, then it would require the test feature be propagated into frame-support, like
impl<Output: Decode + Default> Randomness<Output> for () {
fn random(subject: &[u8]) -> Output {
if cfg!(test) {
Output::decode(&mut TrailingZeroInput::new(subject)).unwrap_or_default()
} else {
panic!("Used () as Randomness in production")
}
}
}
If test already implies std then one might play games with std::collections::hash_map::RandomState but presumably that's more cargo pain than its worth.