Skip to content
Snippets Groups Projects
Commit 7e4d175c authored by Éloïs's avatar Éloïs
Browse files

ref(runtimes): remove our OriginPrivilegeCmp implementation

parent 575a28d1
No related branches found
No related tags found
1 merge request!43Params
......@@ -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 = ();
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment