From 7e4d175c97940670467a27b015565a397a67509c Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Mon, 2 May 2022 00:54:42 +0200 Subject: [PATCH] ref(runtimes): remove our OriginPrivilegeCmp implementation --- runtime/common/src/pallets_config.rs | 13 +------------ runtime/g1/src/lib.rs | 2 +- runtime/gdev/src/lib.rs | 2 +- runtime/gtest/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/runtime/common/src/pallets_config.rs b/runtime/common/src/pallets_config.rs index 04426b32b..98f4a99b3 100644 --- a/runtime/common/src/pallets_config.rs +++ b/runtime/common/src/pallets_config.rs @@ -84,17 +84,6 @@ macro_rules! pallets_config { BlockWeights::get().max_block; pub const MaxScheduledPerBlock: u32 = 50; } - /// Used the compare the privilege of an origin inside the scheduler. - pub struct OriginPrivilegeCmp; - impl frame_support::traits::PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp { - fn cmp_privilege(left: &OriginCaller, right: &OriginCaller) -> Option<core::cmp::Ordering> { - if left == right { - Some(core::cmp::Ordering::Equal) - } else { - None - } - } - } impl pallet_scheduler::Config for Runtime { type Event = Event; type Origin = Origin; @@ -102,7 +91,7 @@ macro_rules! pallets_config { type Call = Call; type MaximumWeight = MaximumSchedulerWeight; type ScheduleOrigin = frame_system::EnsureSigned<AccountId>; - type OriginPrivilegeCmp = OriginPrivilegeCmp; + type OriginPrivilegeCmp = EqualPrivilegeOnly; type MaxScheduledPerBlock = MaxScheduledPerBlock; type WeightInfo = pallet_scheduler::weights::SubstrateWeight<Runtime>; type PreimageProvider = (); diff --git a/runtime/g1/src/lib.rs b/runtime/g1/src/lib.rs index 782745a6a..6ab4dcb8a 100644 --- a/runtime/g1/src/lib.rs +++ b/runtime/g1/src/lib.rs @@ -60,7 +60,7 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, - traits::{KeyOwnerProofSystem, Randomness}, + traits::{EqualPrivilegeOnly, KeyOwnerProofSystem, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, diff --git a/runtime/gdev/src/lib.rs b/runtime/gdev/src/lib.rs index af414220e..cf561427a 100644 --- a/runtime/gdev/src/lib.rs +++ b/runtime/gdev/src/lib.rs @@ -61,7 +61,7 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, - traits::{KeyOwnerProofSystem, Randomness}, + traits::{EqualPrivilegeOnly, KeyOwnerProofSystem, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, diff --git a/runtime/gtest/src/lib.rs b/runtime/gtest/src/lib.rs index 3815715b8..179d22690 100644 --- a/runtime/gtest/src/lib.rs +++ b/runtime/gtest/src/lib.rs @@ -60,7 +60,7 @@ use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. pub use frame_support::{ construct_runtime, parameter_types, - traits::{KeyOwnerProofSystem, Randomness}, + traits::{EqualPrivilegeOnly, KeyOwnerProofSystem, Randomness}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight, WEIGHT_PER_SECOND}, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, -- GitLab