git.delta.rocks / unique-network / refs/commits / f808c0034879

difftreelog

fix(scheduler) privilege cmp config

Daniel Shiposha2022-08-17parent: #0856363.patch.diff
in: master

1 file changed

modifiedruntime/common/config/pallets/scheduler.rsdiffbeforeafterboth
14// You should have received a copy of the GNU General Public License14// You should have received a copy of the GNU General Public License
15// 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/>.
1616
17use 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}
35
36/// Used the compare the privilege of an origin inside the scheduler.
37pub struct OriginPrivilegeCmp;
38
39impl PrivilegeCmp<OriginCaller> for OriginPrivilegeCmp {
40 fn cmp_privilege(_left: &OriginCaller, _right: &OriginCaller) -> Option<Ordering> {
41 Some(Ordering::Equal)
42 }
43}
4434
45impl 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}