replace collective flip with babe randomness in Rialto (#1188)

* replace collective flip with babe randomness in Rialto

* fmt

* fix test
This commit is contained in:
Svyatoslav Nikolsky
2021-10-20 14:56:13 +03:00
committed by Bastian Köcher
parent f4a82d4e81
commit b60df0849c
4 changed files with 3 additions and 11 deletions
-2
View File
@@ -43,7 +43,6 @@ pallet-authority-discovery = { git = "https://github.com/paritytech/substrate",
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-balances = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-randomness-collective-flip = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-session = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-sudo = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false } pallet-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
@@ -105,7 +104,6 @@ std = [
"pallet-bridge-grandpa/std", "pallet-bridge-grandpa/std",
"pallet-bridge-messages/std", "pallet-bridge-messages/std",
"pallet-grandpa/std", "pallet-grandpa/std",
"pallet-randomness-collective-flip/std",
"pallet-shift-session-manager/std", "pallet-shift-session-manager/std",
"pallet-sudo/std", "pallet-sudo/std",
"pallet-timestamp/std", "pallet-timestamp/std",
-3
View File
@@ -216,8 +216,6 @@ impl frame_system::Config for Runtime {
type OnSetCode = (); type OnSetCode = ();
} }
impl pallet_randomness_collective_flip::Config for Runtime {}
/// The BABE epoch configuration at genesis. /// The BABE epoch configuration at genesis.
pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration = pub const BABE_GENESIS_EPOCH_CONFIG: sp_consensus_babe::BabeEpochConfiguration =
sp_consensus_babe::BabeEpochConfiguration { sp_consensus_babe::BabeEpochConfiguration {
@@ -579,7 +577,6 @@ construct_runtime!(
Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>}, Session: pallet_session::{Pallet, Call, Storage, Event, Config<T>},
Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event}, Grandpa: pallet_grandpa::{Pallet, Call, Storage, Config, Event},
ShiftSessionManager: pallet_shift_session_manager::{Pallet}, ShiftSessionManager: pallet_shift_session_manager::{Pallet},
RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage},
// Eth-PoA chains bridge modules. // Eth-PoA chains bridge modules.
BridgeRialtoPoa: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned}, BridgeRialtoPoa: pallet_bridge_eth_poa::<Instance1>::{Pallet, Call, Config, Storage, ValidateUnsigned},
+2 -5
View File
@@ -16,10 +16,7 @@
//! Parachains support in Rialto runtime. //! Parachains support in Rialto runtime.
use crate::{ use crate::{AccountId, Balance, Balances, BlockNumber, Event, Origin, Registrar, Runtime, Slots};
AccountId, Balance, Balances, BlockNumber, Event, Origin, RandomnessCollectiveFlip, Registrar,
Runtime, Slots,
};
use frame_support::{parameter_types, weights::Weight}; use frame_support::{parameter_types, weights::Weight};
use frame_system::EnsureRoot; use frame_system::EnsureRoot;
@@ -59,7 +56,7 @@ impl parachains_inclusion::Config for Runtime {
} }
impl parachains_initializer::Config for Runtime { impl parachains_initializer::Config for Runtime {
type Randomness = RandomnessCollectiveFlip; type Randomness = pallet_babe::RandomnessFromOneEpochAgo<Runtime>;
type ForceOrigin = EnsureRoot<AccountId>; type ForceOrigin = EnsureRoot<AccountId>;
} }
@@ -345,7 +345,7 @@ mod tests {
// then // then
assert!(format!("{:?}", call_hex).starts_with( assert!(format!("{:?}", call_hex).starts_with(
"0x11030000000001000000381409000000000001d43593c715fdd31c61141abd04a99fd6822c8558854cc\ "0x10030000000001000000381409000000000001d43593c715fdd31c61141abd04a99fd6822c8558854cc\
de39a5684e7a56da27d01d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01" de39a5684e7a56da27d01d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d01"
)) ))
} }