difftreelog
fix(scheduler) privilege cmp config
in: master
1 file changed
runtime/common/config/pallets/scheduler.rsdiffbeforeafterboth14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.161617use frame_support::{traits::PrivilegeCmp, weights::Weight, parameter_types};17use frame_support::{traits::EqualPrivilegeOnly, weights::Weight, parameter_types};18use frame_system::EnsureSigned;18use frame_system::EnsureSigned;19use sp_runtime::Perbill;19use sp_runtime::Perbill;20use sp_std::cmp::Ordering;21use crate::{20use crate::{22 runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights},21 runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights},23 Runtime, Call, Event, Origin, OriginCaller, Balances,22 Runtime, Call, Event, Origin, OriginCaller, Balances,33 pub const Preimage: Option<u32> = Some(10);32 pub const Preimage: Option<u32> = Some(10);34}33}3536/// Used the compare the privilege of an origin inside the scheduler.37pub struct OriginPrivilegeCmp;3839impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {40 fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option<Ordering> {41 Some(Ordering::Equal)42 }43}443445impl pallet_unique_scheduler::Config for Runtime {35impl pallet_unique_scheduler::Config for Runtime {46 type RuntimeEvent = RuntimeEvent;36 type RuntimeEvent = RuntimeEvent;53 type MaxScheduledPerBlock = MaxScheduledPerBlock;43 type MaxScheduledPerBlock = MaxScheduledPerBlock;54 type WeightInfo = ();44 type WeightInfo = ();55 type CallExecutor = SchedulerPaymentExecutor;45 type CallExecutor = SchedulerPaymentExecutor;56 type OriginPrivilegeCmp = OriginPrivilegeCmp;46 type OriginPrivilegeCmp = EqualPrivilegeOnly;57 type PreimageProvider = ();47 type PreimageProvider = ();58 type NoPreimagePostponement = NoPreimagePostponement;48 type NoPreimagePostponement = NoPreimagePostponement;59}49}