mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
runtime: use babe as randomness source (#2504)
* runtime: use babe as randomness source * runtime: fix randomness api * bridges: fix random_seed * parachains: use mock TestRandomness from frame_support_test * parachains: use mock TestRandomness from frame_support_test * runtime: update randomness source in test-runtime * runtime: remove unused import * parachains: add todo to audit usage of randomness api * "Update Substrate" Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -22,7 +22,8 @@ use sp_runtime::traits::{
|
||||
BlakeTwo256, IdentityLookup,
|
||||
};
|
||||
use primitives::v1::{AuthorityDiscoveryId, Balance, BlockNumber, Header, ValidatorIndex};
|
||||
use frame_support::{parameter_types, traits::Randomness as RandomnessT};
|
||||
use frame_support::parameter_types;
|
||||
use frame_support_test::TestRandomness;
|
||||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use crate::{
|
||||
@@ -54,14 +55,6 @@ frame_support::construct_runtime!(
|
||||
}
|
||||
);
|
||||
|
||||
pub struct TestRandomness;
|
||||
|
||||
impl RandomnessT<H256> for TestRandomness {
|
||||
fn random(_subject: &[u8]) -> H256 {
|
||||
Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub const BlockHashCount: u32 = 250;
|
||||
pub BlockWeights: frame_system::limits::BlockWeights =
|
||||
@@ -108,7 +101,7 @@ impl pallet_balances::Config for Test {
|
||||
}
|
||||
|
||||
impl crate::initializer::Config for Test {
|
||||
type Randomness = TestRandomness;
|
||||
type Randomness = TestRandomness<Self>;
|
||||
}
|
||||
|
||||
impl crate::configuration::Config for Test { }
|
||||
|
||||
Reference in New Issue
Block a user