mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 09:41:07 +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:
@@ -39,7 +39,9 @@ use runtime_parachains::{
|
||||
runtime_api_impl::v1 as runtime_api_impl,
|
||||
};
|
||||
use frame_support::{
|
||||
parameter_types, construct_runtime, traits::{KeyOwnerProofSystem, Filter, EnsureOrigin}, weights::Weight,
|
||||
construct_runtime, parameter_types,
|
||||
traits::{EnsureOrigin, Filter, KeyOwnerProofSystem, Randomness},
|
||||
weights::Weight,
|
||||
};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
@@ -587,7 +589,7 @@ impl parachains_inclusion_inherent::Config for Runtime {}
|
||||
impl parachains_scheduler::Config for Runtime {}
|
||||
|
||||
impl parachains_initializer::Config for Runtime {
|
||||
type Randomness = Babe;
|
||||
type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
|
||||
}
|
||||
|
||||
impl paras_sudo_wrapper::Config for Runtime {}
|
||||
@@ -681,7 +683,7 @@ sp_api::impl_runtime_apis! {
|
||||
}
|
||||
|
||||
fn random_seed() -> <Block as BlockT>::Hash {
|
||||
Babe::randomness().into()
|
||||
pallet_babe::RandomnessFromOneEpochAgo::<Runtime>::random_seed().0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user