git.delta.rocks / unique-network / refs/commits / 4ad9af73665a

difftreelog

chore remove old scheduler

Daniel Shiposha2022-10-31parent: #27949a3.patch.diff
in: master

12 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5389,7 +5389,6 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unique-scheduler",
  "pallet-unique-scheduler-v2",
  "pallet-xcm",
  "parachain-info",
@@ -6850,25 +6849,6 @@
  "sp-runtime",
  "sp-std",
  "up-data-structs",
-]
-
-[[package]]
-name = "pallet-unique-scheduler"
-version = "0.1.1"
-dependencies = [
- "frame-benchmarking",
- "frame-support",
- "frame-system",
- "log",
- "parity-scale-codec 3.2.1",
- "scale-info",
- "serde",
- "sp-core",
- "sp-io",
- "sp-runtime",
- "sp-std",
- "substrate-test-utils",
- "up-sponsorship",
 ]
 
 [[package]]
@@ -8881,7 +8861,6 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unique-scheduler",
  "pallet-xcm",
  "parachain-info",
  "parity-scale-codec 3.2.1",
@@ -13012,7 +12991,6 @@
  "pallet-transaction-payment-rpc-runtime-api",
  "pallet-treasury",
  "pallet-unique",
- "pallet-unique-scheduler",
  "pallet-xcm",
  "parachain-info",
  "parity-scale-codec 3.2.1",
deletedpallets/scheduler/CHANGELOG.mddiffbeforeafterboth
--- a/pallets/scheduler/CHANGELOG.md
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- bureaucrate goes here -->
-## [v0.1.1] 2022-08-16
-
-### Other changes
-
-- build: Upgrade polkadot to v0.9.27 2c498572636f2b34d53b1c51b7283a761a7dc90a
-
-- build: Upgrade polkadot to v0.9.26 85515e54c4ca1b82a2630034e55dcc804c643bf8
-
-- build: Upgrade polkadot to v0.9.25 cdfb9bdc7b205ff1b5134f034ef9973d769e5e6b
\ No newline at end of file
deletedpallets/scheduler/Cargo.tomldiffbeforeafterboth
--- a/pallets/scheduler/Cargo.toml
+++ /dev/null
@@ -1,53 +0,0 @@
-[package]
-name = "pallet-unique-scheduler"
-version = "0.1.1"
-authors = ["Unique Network <support@uniquenetwork.io>"]
-edition = "2021"
-license = "GPLv3"
-homepage = "https://unique.network"
-repository = "https://github.com/UniqueNetwork/unique-chain"
-description = "Unique Scheduler pallet"
-readme = "README.md"
-
-[dependencies]
-serde = { version = "1.0.130", default-features = false }
-codec = { package = "parity-scale-codec", version = "3.1.2", default-features = false }
-scale-info = { version = "2.0.1", default-features = false, features = [
-	"derive",
-] }
-
-frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-io = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-sp-core = { default-features = false, git = 'https://github.com/paritytech/substrate.git', branch = 'polkadot-v0.9.30' }
-frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-
-up-sponsorship = { version = "0.1.0", default-features = false, git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30" }
-log = { version = "0.4.16", default-features = false }
-
-[dev-dependencies]
-sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }
-
-[features]
-default = ["std"]
-std = [
-	"codec/std",
-	"sp-runtime/std",
-	"frame-benchmarking/std",
-	"frame-support/std",
-	"frame-system/std",
-	"up-sponsorship/std",
-	"sp-io/std",
-	"sp-std/std",
-	"sp-core/std",
-	"log/std",
-]
-runtime-benchmarks = [
-	"frame-benchmarking",
-	"frame-support/runtime-benchmarks",
-	"frame-system/runtime-benchmarks",
-]
-try-runtime = ["frame-support/try-runtime"]
deletedpallets/scheduler/README.mddiffbeforeafterboth
--- a/pallets/scheduler/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-# Scheduler
-A module for scheduling dispatches.
-
-- [`scheduler::Trait`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/trait.Trait.html)
-- [`Call`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/enum.Call.html)
-- [`Module`](https://docs.rs/pallet-scheduler/latest/pallet_scheduler/struct.Module.html)
-
-## Overview
-
-This module exposes capabilities for scheduling dispatches to occur at a
-specified block number or at a specified period. These scheduled dispatches
-may be named or anonymous and may be canceled.
-
-**NOTE:** The scheduled calls will be dispatched with the default filter
-for the origin: namely `frame_system::Config::BaseCallFilter` for all origin
-except root which will get no filter. And not the filter contained in origin
-use to call `fn schedule`.
-
-If a call is scheduled using proxy or whatever mecanism which adds filter,
-then those filter will not be used when dispatching the schedule call.
-
-## Interface
-
-### Dispatchable Functions
-
-* `schedule` - schedule a dispatch, which may be periodic, to occur at a
-  specified block and with a specified priority.
-* `cancel` - cancel a scheduled dispatch, specified by block number and
-  index.
-* `schedule_named` - augments the `schedule` interface with an additional
-  `Vec<u8>` parameter that can be used for identification.
-* `cancel_named` - the named complement to the cancel function.
-
-License: Unlicense
deletedpallets/scheduler/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/benchmarking.rs
+++ /dev/null
@@ -1,260 +0,0 @@
-// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.
-// This file is part of Unique Network.
-
-// Unique Network is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-
-// Unique Network is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
-
-// Original license
-// This file is part of Substrate.
-
-// Copyright (C) 2020-2021 Parity Technologies (UK) Ltd.
-// SPDX-License-Identifier: Apache-2.0
-
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// 	http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//! Scheduler pallet benchmarking.
-
-use super::*;
-use frame_benchmarking::{benchmarks, account};
-use frame_support::{
-	ensure,
-	traits::{OnInitialize},
-};
-use frame_system::RawOrigin;
-use sp_runtime::traits::Hash;
-use sp_std::{prelude::*, vec};
-
-use crate::Pallet as Scheduler;
-use frame_system::Pallet as System;
-use frame_support::traits::Currency;
-
-const BLOCK_NUMBER: u32 = 2;
-
-fn make_scheduled_id(src: u32) -> ScheduledId {
-	let slice_id: [u8; 4] = src.encode().try_into().unwrap();
-	let mut id: [u8; 16] = [0; 16];
-	id[..4].clone_from_slice(&slice_id);
-	id
-}
-
-/// Add `n` named items to the schedule.
-///
-/// For `resolved`:
-/// - `None`: aborted (hash without preimage)
-/// - `Some(true)`: hash resolves into call if possible, plain call otherwise
-/// - `Some(false)`: plain call
-fn fill_schedule<T: Config>(
-	when: T::BlockNumber,
-	n: u32,
-	periodic: bool,
-	resolved: Option<bool>,
-) -> Result<(), &'static str> {
-	let t = DispatchTime::At(when);
-	let caller = account("user", 0, 1);
-
-	// Give the sender account max funds for transfer (their account will never reasonably be killed).
-	T::Currency::make_free_balance_be(&caller, T::Currency::minimum_balance());
-
-	for i in 0..n {
-		let (call, hash) = call_and_hash::<T>(i);
-		let call_or_hash = match resolved {
-			Some(_) => call.into(),
-			None => CallOrHashOf::<T>::Hash(hash),
-		};
-		let period = match periodic {
-			true => Some(((i + 100).into(), 100)),
-			false => None,
-		};
-
-		let id = make_scheduled_id(i);
-		let origin = frame_system::RawOrigin::Signed(caller.clone()).into();
-		Scheduler::<T>::do_schedule_named(id, t, period, 0, origin, call_or_hash)?;
-	}
-	ensure!(
-		Agenda::<T>::get(when).len() == n as usize,
-		"didn't fill schedule"
-	);
-	Ok(())
-}
-
-fn call_and_hash<T: Config>(i: u32) -> (<T as Config>::RuntimeCall, T::Hash) {
-	// Essentially a no-op call.
-	let call: <T as Config>::RuntimeCall = frame_system::Call::remark { remark: i.encode() }.into();
-	let hash = T::Hashing::hash_of(&call);
-	(call, hash)
-}
-
-benchmarks! {
-	on_initialize_periodic_named_resolved {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, true, Some(true))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		for i in 0..s {
-			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
-		}
-	}
-
-	on_initialize_named_resolved {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, Some(true))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		assert!(Agenda::<T>::iter().count() == 0);
-	}
-
-	on_initialize_periodic {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, true, Some(false))?;
-	}: { Scheduler::<T>::on_initialize(when); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		for i in 0..s {
-			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
-		}
-	}
-
-	on_initialize_periodic_resolved {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, true, Some(true))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s );
-		for i in 0..s {
-			assert_eq!(Agenda::<T>::get(when + (i + 100).into()).len(), 1 as usize);
-		}
-	}
-
-	on_initialize_aborted {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, None)?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), 0);
-	}
-
-	on_initialize_named_aborted {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, Some(false))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-	}
-
-	on_initialize_named {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, None)?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), 0);
-	}
-
-	on_initialize {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, Some(false))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		assert!(Agenda::<T>::iter().count() == 0);
-	}
-
-	on_initialize_resolved {
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		fill_schedule::<T>(when, s, false, Some(true))?;
-	}: { Scheduler::<T>::on_initialize(BLOCK_NUMBER.into()); }
-	verify {
-		assert_eq!(System::<T>::event_count(), s);
-		assert!(Agenda::<T>::iter().count() == 0);
-	}
-
-	schedule_named {
-		let caller: T::AccountId = account("user", 0, 1);
-		let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
-		let s in 0 .. T::MaxScheduledPerBlock::get();
-		let slice_id: [u8; 4] = s.encode().try_into().unwrap();
-		let mut id: [u8; 16] =  [0; 16];
-		id[..4].clone_from_slice(&slice_id);
-		let when = BLOCK_NUMBER.into();
-		let periodic = Some((T::BlockNumber::one(), 100));
-		let priority = None;
-		// Essentially a no-op call.
-		let inner_call = frame_system::Call::set_storage { items: vec![] }.into();
-		let call = Box::new(CallOrHashOf::<T>::Value(inner_call));
-		fill_schedule::<T>(when, s, true, Some(false))?;
-	}: _(origin, id, when, periodic, priority, call)
-	verify {
-		ensure!(
-			Agenda::<T>::get(when).len() == (s + 1) as usize,
-			"didn't add to schedule"
-		);
-	}
-
-	cancel_named {
-		let caller: T::AccountId = account("user", 0, 1);
-		let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Signed(caller.clone());
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		let idx = s - 1;
-		let id = make_scheduled_id(idx);
-		fill_schedule::<T>(when, s, true, Some(false))?;
-	}: _(origin, id)
-	verify {
-		ensure!(
-			Lookup::<T>::get(id).is_none(),
-			"didn't remove from lookup"
-		);
-		// Removed schedule is NONE
-		ensure!(
-			Agenda::<T>::get(when)[idx as usize].is_none(),
-			"didn't remove from schedule"
-		);
-	}
-
-	change_named_priority {
-		let origin: RawOrigin<T::AccountId> = frame_system::RawOrigin::Root;
-		let s in 1 .. T::MaxScheduledPerBlock::get();
-		let when = BLOCK_NUMBER.into();
-		let idx = s - 1;
-		let id = make_scheduled_id(idx);
-		let priority = 42;
-		fill_schedule::<T>(when, s, true, Some(false))?;
-	}: _(origin, id, priority)
-	verify {
-		ensure!(
-			Agenda::<T>::get(when)[idx as usize].clone().unwrap().priority == priority,
-			"didn't change the priority"
-		);
-	}
-
-	impl_benchmark_test_suite!(Scheduler, crate::mock::new_test_ext(), crate::mock::Test);
-}
deletedpallets/scheduler/src/lib.rsdiffbeforeafterboth
before · pallets/scheduler/src/lib.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617// Original license:18// This file is part of Substrate.1920// Copyright (C) 2017-2022 Parity Technologies (UK) Ltd.21// SPDX-License-Identifier: Apache-2.02223// Licensed under the Apache License, Version 2.0 (the "License");24// you may not use this file except in compliance with the License.25// You may obtain a copy of the License at26//27// 	<http://www.apache.org/licenses/LICENSE-2.0>28//29// Unless required by applicable law or agreed to in writing, software30// distributed under the License is distributed on an "AS IS" BASIS,31// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.32// See the License for the specific language governing permissions and33// limitations under the License.3435//! # Unique scheduler36//! A Pallet for scheduling dispatches.37//!38//! - [`Config`]39//! - [`Call`]40//! - [`Pallet`]41//!42//! ## Overview43//!44//! This Pallet exposes capabilities for scheduling dispatches to occur at a45//! specified block number or at a specified period. These scheduled dispatches46//! should be named and may be canceled.47//!48//! **NOTE:** The unique scheduler is designed for deferred transaction calls by block number.49//! Any user can book a call of a certain transaction to a specific block number.50//! Also possible to book a call with a certain frequency.51//!52//! Key differences from the original pallet:53//! <https://crates.io/crates/pallet-scheduler>54//! Schedule Id restricted by 16 bytes. Identificator for booked call.55//! Priority limited by HARD DEADLINE (<= 63). Calls over maximum weight don't include to block.56//! The maximum weight that may be scheduled per block for any dispatchables of less priority than `schedule::HARD_DEADLINE`.57//! Maybe_periodic limit is 100 calls. Reserved for future sponsored transaction support.58//! At 100 calls reserved amount is not so much and this is avoid potential problems with balance locks.59//! Any account allowed to schedule any calls. Account withdraw implemented through default transaction logic.60//!61//! ## Interface62//!63//! ### Dispatchable Functions64//!65//! * `schedule_named` - augments the `schedule` interface with an additional `Vec<u8>` parameter66//!   that can be used for identification.67//! * `cancel_named` - the named complement to the cancel function.6869// Ensure we're `no_std` when compiling for Wasm.70#![cfg_attr(not(feature = "std"), no_std)]7172#[cfg(feature = "runtime-benchmarks")]73mod benchmarking;7475pub mod weights;7677use sp_core::H160;78use codec::{Codec, Decode, Encode};79use frame_system::{self as system, ensure_signed};80pub use pallet::*;81use scale_info::TypeInfo;82use sp_runtime::{83	traits::{BadOrigin, One, Saturating, Zero},84	RuntimeDebug, DispatchErrorWithPostInfo,85};86use sp_std::{borrow::Borrow, cmp::Ordering, marker::PhantomData, prelude::*};8788use frame_support::{89	dispatch::{90		DispatchError, DispatchResult, Dispatchable, UnfilteredDispatchable, Parameter,91		GetDispatchInfo,92	},93	traits::{94		schedule::{self, DispatchTime, MaybeHashed},95		NamedReservableCurrency, EnsureOrigin, Get, IsType, OriginTrait, PrivilegeCmp,96		StorageVersion,97	},98	weights::{Weight},99};100101pub use weights::WeightInfo;102103/// The location of a scheduled task that can be used to remove it.104pub type TaskAddress<BlockNumber> = (BlockNumber, u32);105pub const MAX_TASK_ID_LENGTH_IN_BYTES: u8 = 16;106107pub type ScheduledId = [u8; MAX_TASK_ID_LENGTH_IN_BYTES as usize];108pub type CallOrHashOf<T> =109	MaybeHashed<<T as Config>::RuntimeCall, <T as frame_system::Config>::Hash>;110111/// Information regarding an item to be executed in the future.112#[cfg_attr(any(feature = "std", test), derive(PartialEq, Eq))]113#[derive(Clone, RuntimeDebug, Encode, Decode, TypeInfo)]114pub struct ScheduledV3<Call, BlockNumber, PalletsOrigin, AccountId> {115	/// The unique identity for this task, if there is one.116	maybe_id: Option<ScheduledId>,117	/// This task's priority.118	priority: schedule::Priority,119	/// The call to be dispatched.120	call: Call,121	/// If the call is periodic, then this points to the information concerning that.122	maybe_periodic: Option<schedule::Period<BlockNumber>>,123	/// The origin to dispatch the call.124	origin: PalletsOrigin,125	_phantom: PhantomData<AccountId>,126}127128pub type ScheduledV3Of<T> = ScheduledV3<129	CallOrHashOf<T>,130	<T as frame_system::Config>::BlockNumber,131	<T as Config>::PalletsOrigin,132	<T as frame_system::Config>::AccountId,133>;134135pub type ScheduledOf<T> = ScheduledV3Of<T>;136137/// The current version of Scheduled struct.138pub type Scheduled<Call, BlockNumber, PalletsOrigin, AccountId> =139	ScheduledV3<Call, BlockNumber, PalletsOrigin, AccountId>;140141pub enum ScheduledEnsureOriginSuccess<AccountId> {142	Root,143	Signed(AccountId),144}145146#[cfg(feature = "runtime-benchmarks")]147mod preimage_provider {148	use frame_support::traits::PreimageRecipient;149	pub trait PreimageProviderAndMaybeRecipient<H>: PreimageRecipient<H> {}150	impl<H, T: PreimageRecipient<H>> PreimageProviderAndMaybeRecipient<H> for T {}151}152153#[cfg(not(feature = "runtime-benchmarks"))]154mod preimage_provider {155	use frame_support::traits::PreimageProvider;156	pub trait PreimageProviderAndMaybeRecipient<H>: PreimageProvider<H> {}157	impl<H, T: PreimageProvider<H>> PreimageProviderAndMaybeRecipient<H> for T {}158}159160pub use preimage_provider::PreimageProviderAndMaybeRecipient;161162pub(crate) trait MarginalWeightInfo: WeightInfo {163	fn item(periodic: bool, named: bool, resolved: Option<bool>) -> Weight {164		match (periodic, named, resolved) {165			(_, false, None) => Self::on_initialize_aborted(2) - Self::on_initialize_aborted(1),166			(_, true, None) => {167				Self::on_initialize_named_aborted(2) - Self::on_initialize_named_aborted(1)168			}169			(false, false, Some(false)) => Self::on_initialize(2) - Self::on_initialize(1),170			(false, true, Some(false)) => {171				Self::on_initialize_named(2) - Self::on_initialize_named(1)172			}173			(true, false, Some(false)) => {174				Self::on_initialize_periodic(2) - Self::on_initialize_periodic(1)175			}176			(true, true, Some(false)) => {177				Self::on_initialize_periodic_named_resolved(2)178					- Self::on_initialize_periodic_named_resolved(1)179			}180			(false, false, Some(true)) => Self::on_initialize(2) - Self::on_initialize(1),181			(false, true, Some(true)) => {182				Self::on_initialize_named_resolved(2) - Self::on_initialize_named_resolved(1)183			}184			(true, false, Some(true)) => {185				Self::on_initialize_periodic_resolved(2) - Self::on_initialize_periodic_resolved(1)186			}187			(true, true, Some(true)) => {188				Self::on_initialize_periodic_named_resolved(2)189					- Self::on_initialize_periodic_named_resolved(1)190			}191		}192	}193}194impl<T: WeightInfo> MarginalWeightInfo for T {}195196#[frame_support::pallet]197pub mod pallet {198	use super::*;199	use frame_support::{200		dispatch::PostDispatchInfo,201		pallet_prelude::*,202		traits::{203			schedule::{LookupError, LOWEST_PRIORITY},204			PreimageProvider,205		},206	};207	use frame_system::pallet_prelude::*;208209	/// The current storage version.210	const STORAGE_VERSION: StorageVersion = StorageVersion::new(3);211212	#[pallet::pallet]213	#[pallet::generate_store(pub(super) trait Store)]214	#[pallet::storage_version(STORAGE_VERSION)]215	#[pallet::without_storage_info]216	pub struct Pallet<T>(_);217218	/// `system::Config` should always be included in our implied traits.219	#[pallet::config]220	pub trait Config: frame_system::Config {221		/// The overarching event type.222		type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;223224		/// The aggregated origin which the dispatch will take.225		type RuntimeOrigin: OriginTrait<PalletsOrigin = Self::PalletsOrigin>226			+ From<Self::PalletsOrigin>227			+ IsType<<Self as system::Config>::RuntimeOrigin>;228229		/// The caller origin, overarching type of all pallets origins.230		type PalletsOrigin: From<system::RawOrigin<Self::AccountId>> + Codec + Clone + Eq + TypeInfo;231232		type Currency: NamedReservableCurrency<Self::AccountId, ReserveIdentifier = ScheduledId>;233234		/// The aggregated call type.235		type RuntimeCall: Parameter236			+ Dispatchable<237				RuntimeOrigin = <Self as Config>::RuntimeOrigin,238				PostInfo = PostDispatchInfo,239			> + UnfilteredDispatchable<RuntimeOrigin = <Self as system::Config>::RuntimeOrigin>240			+ GetDispatchInfo241			+ From<system::Call<Self>>;242243		/// The maximum weight that may be scheduled per block for any dispatchables of less244		/// priority than `schedule::HARD_DEADLINE`.245		#[pallet::constant]246		type MaximumWeight: Get<Weight>;247248		/// Required origin to schedule or cancel calls.249		type ScheduleOrigin: EnsureOrigin<250			<Self as system::Config>::RuntimeOrigin,251			Success = ScheduledEnsureOriginSuccess<Self::AccountId>,252		>;253254		/// Required origin to set/change calls' priority.255		type PrioritySetOrigin: EnsureOrigin<<Self as system::Config>::RuntimeOrigin>;256257		/// Compare the privileges of origins.258		///259		/// This will be used when canceling a task, to ensure that the origin that tries260		/// to cancel has greater or equal privileges as the origin that created the scheduled task.261		///262		/// For simplicity the [`EqualPrivilegeOnly`](frame_support::traits::EqualPrivilegeOnly) can263		/// be used. This will only check if two given origins are equal.264		type OriginPrivilegeCmp: PrivilegeCmp<Self::PalletsOrigin>;265266		/// The maximum number of scheduled calls in the queue for a single block.267		/// Not strictly enforced, but used for weight estimation.268		#[pallet::constant]269		type MaxScheduledPerBlock: Get<u32>;270271		/// Weight information for extrinsics in this pallet.272		type WeightInfo: WeightInfo;273274		/// The preimage provider with which we look up call hashes to get the call.275		type PreimageProvider: PreimageProviderAndMaybeRecipient<Self::Hash>;276277		/// If `Some` then the number of blocks to postpone execution for when the item is delayed.278		type NoPreimagePostponement: Get<Option<Self::BlockNumber>>;279280		/// Sponsoring function.281		// type SponsorshipHandler: SponsorshipHandler<Self::AccountId, <Self as Config>::Call>;282283		/// The helper type used for custom transaction fee logic.284		type CallExecutor: DispatchCall<Self, H160>;285	}286287	/// A Scheduler-Runtime interface for finer payment handling.288	pub trait DispatchCall<T: frame_system::Config + Config, SelfContainedSignedInfo> {289		/// Reserve (lock) the maximum spendings on a call, calculated from its weight and the repetition count.290		fn reserve_balance(291			id: ScheduledId,292			sponsor: <T as frame_system::Config>::AccountId,293			call: <T as Config>::RuntimeCall,294			count: u32,295		) -> Result<(), DispatchError>;296297		/// Unreserve (unlock) a certain amount from the payer's reserved funds, returning the change.298		fn pay_for_call(299			id: ScheduledId,300			sponsor: <T as frame_system::Config>::AccountId,301			call: <T as Config>::RuntimeCall,302		) -> Result<u128, DispatchError>;303304		/// Resolve the call dispatch, including any post-dispatch operations.305		fn dispatch_call(306			signer: Option<T::AccountId>,307			function: <T as Config>::RuntimeCall,308		) -> Result<309			Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,310			TransactionValidityError,311		>;312313		/// Release unspent reserved funds in case of a schedule cancel.314		fn cancel_reserve(315			id: ScheduledId,316			sponsor: <T as frame_system::Config>::AccountId,317		) -> Result<u128, DispatchError>;318	}319320	/// Items to be executed, indexed by the block number that they should be executed on.321	#[pallet::storage]322	pub type Agenda<T: Config> =323		StorageMap<_, Twox64Concat, T::BlockNumber, Vec<Option<ScheduledV3Of<T>>>, ValueQuery>;324325	/// Lookup from identity to the block number and index of the task.326	#[pallet::storage]327	pub(crate) type Lookup<T: Config> =328		StorageMap<_, Twox64Concat, ScheduledId, TaskAddress<T::BlockNumber>>;329330	/// Events type.331	#[pallet::event]332	#[pallet::generate_deposit(pub(super) fn deposit_event)]333	pub enum Event<T: Config> {334		/// Scheduled some task.335		Scheduled { when: T::BlockNumber, index: u32 },336		/// Canceled some task.337		Canceled { when: T::BlockNumber, index: u32 },338		/// Scheduled task's priority has changed339		PriorityChanged {340			when: T::BlockNumber,341			index: u32,342			priority: schedule::Priority,343		},344		/// Dispatched some task.345		Dispatched {346			task: TaskAddress<T::BlockNumber>,347			id: Option<ScheduledId>,348			result: DispatchResult,349		},350		/// The call for the provided hash was not found so the task has been aborted.351		CallLookupFailed {352			task: TaskAddress<T::BlockNumber>,353			id: Option<ScheduledId>,354			error: LookupError,355		},356	}357358	#[pallet::error]359	pub enum Error<T> {360		/// Failed to schedule a call361		FailedToSchedule,362		/// Cannot find the scheduled call.363		NotFound,364		/// Given target block number is in the past.365		TargetBlockNumberInPast,366		/// Reschedule failed because it does not change scheduled time.367		RescheduleNoChange,368	}369370	#[pallet::hooks]371	impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {372		/// Execute the scheduled calls373		fn on_initialize(now: T::BlockNumber) -> Weight {374			let limit = T::MaximumWeight::get();375376			let mut queued = Agenda::<T>::take(now)377				.into_iter()378				.enumerate()379				.filter_map(|(index, s)| Some((index as u32, s?)))380				.collect::<Vec<_>>();381382			if queued.len() as u32 > T::MaxScheduledPerBlock::get() {383				log::warn!(384					target: "runtime::scheduler",385					"Warning: This block has more items queued in Scheduler than \386					expected from the runtime configuration. An update might be needed."387				);388			}389390			queued.sort_by_key(|(_, s)| s.priority);391392			let next = now + One::one();393394			let mut total_weight: Weight = T::WeightInfo::on_initialize(0);395			for (order, (index, mut s)) in queued.into_iter().enumerate() {396				let named = s.maybe_id.is_some();397398				let (call, maybe_completed) = s.call.resolved::<T::PreimageProvider>();399				s.call = call;400401				let resolved = if let Some(completed) = maybe_completed {402					T::PreimageProvider::unrequest_preimage(&completed);403					true404				} else {405					false406				};407				let call = match s.call.as_value().cloned() {408					Some(c) => c,409					None => {410						// Preimage not available - postpone until some block.411						total_weight.saturating_accrue(T::WeightInfo::item(false, named, None));412						if let Some(delay) = T::NoPreimagePostponement::get() {413							let until = now.saturating_add(delay);414							if let Some(ref id) = s.maybe_id {415								let index = Agenda::<T>::decode_len(until).unwrap_or(0);416								Lookup::<T>::insert(id, (until, index as u32));417							}418							Agenda::<T>::append(until, Some(s));419						} else if let Some(ref id) = s.maybe_id {420							Lookup::<T>::remove(id);421						}422						continue;423					}424				};425426				let periodic = s.maybe_periodic.is_some();427				let call_weight = call.get_dispatch_info().weight;428				let mut item_weight = T::WeightInfo::item(periodic, named, Some(resolved));429				let origin = <<T as Config>::RuntimeOrigin as From<T::PalletsOrigin>>::from(430					s.origin.clone(),431				)432				.into();433				if ensure_signed(origin).is_ok() {434					// Weights of Signed dispatches expect their signing account to be whitelisted.435					item_weight.saturating_accrue(T::DbWeight::get().reads_writes(1, 1));436				}437438				// We allow a scheduled call if any is true:439				// - It's priority is `HARD_DEADLINE`440				// - It does not push the weight past the limit.441				// - It is the first item in the schedule442				let hard_deadline = s.priority <= schedule::HARD_DEADLINE;443				let test_weight = total_weight444					.saturating_add(call_weight)445					.saturating_add(item_weight);446				if !hard_deadline && order > 0 && test_weight.all_gt(limit) {447					// Cannot be scheduled this block - postpone until next.448					total_weight.saturating_accrue(T::WeightInfo::item(false, named, None));449					if let Some(ref id) = s.maybe_id {450						// NOTE: We could reasonably not do this (in which case there would be one451						// block where the named and delayed item could not be referenced by name),452						// but we will do it anyway since it should be mostly free in terms of453						// weight and it is slightly cleaner.454						let index = Agenda::<T>::decode_len(next).unwrap_or(0);455						Lookup::<T>::insert(id, (next, index as u32));456					}457					Agenda::<T>::append(next, Some(s));458					continue;459				}460461				let scheduled_origin =462					<<T as Config>::RuntimeOrigin as From<T::PalletsOrigin>>::from(463						s.origin.clone(),464					);465				let ensured_origin = T::ScheduleOrigin::ensure_origin(scheduled_origin.into());466467				let r = match ensured_origin {468					Ok(ScheduledEnsureOriginSuccess::Root) => {469						Ok(call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()))470					}471					Ok(ScheduledEnsureOriginSuccess::Signed(sender)) => {472						// Execute transaction via chain default pipeline473						// That means dispatch will be processed like any user's extrinsic e.g. transaction fees will be taken474						T::CallExecutor::dispatch_call(Some(sender), call.clone())475					}476					Err(e) => Ok(Err(e.into())),477				};478479				let mut actual_call_weight: Weight = item_weight;480				let result: Result<_, DispatchError> = match r {481					Ok(o) => match o {482						Ok(di) => {483							actual_call_weight = di.actual_weight.unwrap_or(item_weight);484							Ok(())485						}486						Err(err) => Err(err.error),487					},488					Err(_) => {489						log::error!(490							target: "runtime::scheduler",491							"Warning: Scheduler has failed to execute a post-dispatch transaction. \492							This block might have become invalid.");493						Err(DispatchError::CannotLookup)494					} // todo possibly force a skip/return here, do something with the error495				};496497				total_weight.saturating_accrue(item_weight);498				total_weight.saturating_accrue(actual_call_weight);499500				Self::deposit_event(Event::Dispatched {501					task: (now, index),502					id: s.maybe_id.clone(),503					result,504				});505506				if let &Some((period, count)) = &s.maybe_periodic {507					if count > 1 {508						s.maybe_periodic = Some((period, count - 1));509					} else {510						s.maybe_periodic = None;511					}512					let wake = now + period;513					let is_canceled;514515					// If scheduled is named, place its information in `Lookup`516					if let Some(ref id) = s.maybe_id {517						is_canceled = Lookup::<T>::get(id).is_none();518						let wake_index = Agenda::<T>::decode_len(wake).unwrap_or(0);519520						if !is_canceled {521							Lookup::<T>::insert(id, (wake, wake_index as u32));522						}523					} else {524						is_canceled = false;525					}526527					if !is_canceled {528						Agenda::<T>::append(wake, Some(s));529					}530				} else if let Some(ref id) = s.maybe_id {531					Lookup::<T>::remove(id);532				}533			}534			total_weight535		}536	}537538	#[pallet::call]539	impl<T: Config> Pallet<T> {540		/// Schedule a named task.541		#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]542		pub fn schedule_named(543			origin: OriginFor<T>,544			id: ScheduledId,545			when: T::BlockNumber,546			maybe_periodic: Option<schedule::Period<T::BlockNumber>>,547			priority: Option<schedule::Priority>,548			call: Box<CallOrHashOf<T>>,549		) -> DispatchResult {550			T::ScheduleOrigin::ensure_origin(origin.clone())?;551552			if priority.is_some() {553				T::PrioritySetOrigin::ensure_origin(origin.clone())?;554			}555556			let origin = <T as Config>::RuntimeOrigin::from(origin);557			Self::do_schedule_named(558				id,559				DispatchTime::At(when),560				maybe_periodic,561				priority.unwrap_or(LOWEST_PRIORITY),562				origin.caller().clone(),563				*call,564			)?;565			Ok(())566		}567568		/// Cancel a named scheduled task.569		#[pallet::weight(<T as Config>::WeightInfo::cancel_named(T::MaxScheduledPerBlock::get()))]570		pub fn cancel_named(origin: OriginFor<T>, id: ScheduledId) -> DispatchResult {571			T::ScheduleOrigin::ensure_origin(origin.clone())?;572			let origin = <T as Config>::RuntimeOrigin::from(origin);573			Self::do_cancel_named(Some(origin.caller().clone()), id)?;574			Ok(())575		}576577		/// Schedule a named task after a delay.578		///579		/// # <weight>580		/// Same as [`schedule_named`](Self::schedule_named).581		/// # </weight>582		#[pallet::weight(<T as Config>::WeightInfo::schedule_named(T::MaxScheduledPerBlock::get()))]583		pub fn schedule_named_after(584			origin: OriginFor<T>,585			id: ScheduledId,586			after: T::BlockNumber,587			maybe_periodic: Option<schedule::Period<T::BlockNumber>>,588			priority: Option<schedule::Priority>,589			call: Box<CallOrHashOf<T>>,590		) -> DispatchResult {591			T::ScheduleOrigin::ensure_origin(origin.clone())?;592593			if priority.is_some() {594				T::PrioritySetOrigin::ensure_origin(origin.clone())?;595			}596597			let origin = <T as Config>::RuntimeOrigin::from(origin);598			Self::do_schedule_named(599				id,600				DispatchTime::After(after),601				maybe_periodic,602				priority.unwrap_or(LOWEST_PRIORITY),603				origin.caller().clone(),604				*call,605			)?;606			Ok(())607		}608609		#[pallet::weight(<T as Config>::WeightInfo::change_named_priority(T::MaxScheduledPerBlock::get()))]610		pub fn change_named_priority(611			origin: OriginFor<T>,612			id: ScheduledId,613			priority: schedule::Priority,614		) -> DispatchResult {615			T::PrioritySetOrigin::ensure_origin(origin.clone())?;616			let origin = <T as Config>::RuntimeOrigin::from(origin);617			Self::do_change_named_priority(origin.caller().clone(), id, priority)618		}619	}620}621622impl<T: Config> Pallet<T> {623	#[cfg(feature = "try-runtime")]624	pub fn pre_migrate_to_v3() -> Result<(), &'static str> {625		Ok(())626	}627628	#[cfg(feature = "try-runtime")]629	pub fn post_migrate_to_v3() -> Result<(), &'static str> {630		use frame_support::dispatch::GetStorageVersion;631632		assert!(Self::current_storage_version() == 3);633		for k in Agenda::<T>::iter_keys() {634			let _ = Agenda::<T>::try_get(k).map_err(|()| "Invalid item in Agenda")?;635		}636		Ok(())637	}638639	/// Helper to migrate scheduler when the pallet origin type has changed.640	pub fn migrate_origin<OldOrigin: Into<T::PalletsOrigin> + codec::Decode>() {641		Agenda::<T>::translate::<642			Vec<Option<Scheduled<CallOrHashOf<T>, T::BlockNumber, OldOrigin, T::AccountId>>>,643			_,644		>(|_, agenda| {645			Some(646				agenda647					.into_iter()648					.map(|schedule| {649						schedule.map(|schedule| Scheduled {650							maybe_id: schedule.maybe_id,651							priority: schedule.priority,652							call: schedule.call,653							maybe_periodic: schedule.maybe_periodic,654							origin: schedule.origin.into(),655							_phantom: Default::default(),656						})657					})658					.collect::<Vec<_>>(),659			)660		});661	}662663	fn resolve_time(when: DispatchTime<T::BlockNumber>) -> Result<T::BlockNumber, DispatchError> {664		let now = frame_system::Pallet::<T>::block_number();665666		let when = match when {667			DispatchTime::At(x) => x,668			// The current block has already completed it's scheduled tasks, so669			// Schedule the task at lest one block after this current block.670			DispatchTime::After(x) => now.saturating_add(x).saturating_add(One::one()),671		};672673		if when <= now {674			return Err(Error::<T>::TargetBlockNumberInPast.into());675		}676677		Ok(when)678	}679680	fn do_schedule_named(681		id: ScheduledId,682		when: DispatchTime<T::BlockNumber>,683		maybe_periodic: Option<schedule::Period<T::BlockNumber>>,684		priority: schedule::Priority,685		origin: T::PalletsOrigin,686		call: CallOrHashOf<T>,687	) -> Result<TaskAddress<T::BlockNumber>, DispatchError> {688		// ensure id it is unique689		if Lookup::<T>::contains_key(&id) {690			return Err(Error::<T>::FailedToSchedule)?;691		}692693		let when = Self::resolve_time(when)?;694695		call.ensure_requested::<T::PreimageProvider>();696697		// sanitize maybe_periodic698		let maybe_periodic = maybe_periodic699			.filter(|p| p.1 > 1 && !p.0.is_zero())700			// Remove one from the number of repetitions since we will schedule one now.701			.map(|(p, c)| (p, c - 1));702703		let s = Scheduled {704			maybe_id: Some(id.clone()),705			priority,706			call: call.clone(),707			maybe_periodic,708			origin: origin.clone(),709			_phantom: Default::default(),710		};711712		// reserve balance for periodic execution713		// let sender =714		// 	ensure_signed(<<T as Config>::Origin as From<T::PalletsOrigin>>::from(origin).into())?;715		// let repeats = match maybe_periodic {716		// 	Some(p) => p.1,717		// 	None => 1,718		// };719		// let _ = T::CallExecutor::reserve_balance(720		// 	id.clone(),721		// 	sender,722		// 	call.as_value().unwrap().clone(),723		// 	repeats,724		// );725726		Agenda::<T>::append(when, Some(s));727		let index = Agenda::<T>::decode_len(when).unwrap_or(1) as u32 - 1;728		let address = (when, index);729		Lookup::<T>::insert(&id, &address);730		Self::deposit_event(Event::Scheduled { when, index });731732		Ok(address)733	}734735	fn do_cancel_named(origin: Option<T::PalletsOrigin>, id: ScheduledId) -> DispatchResult {736		Lookup::<T>::try_mutate_exists(id, |lookup| -> DispatchResult {737			if let Some((when, index)) = lookup.take() {738				let i = index as usize;739				Agenda::<T>::try_mutate(when, |agenda| -> DispatchResult {740					if let Some(s) = agenda.get_mut(i) {741						if let (Some(ref o), Some(ref s)) = (origin.clone(), s.borrow()) {742							if matches!(743								T::OriginPrivilegeCmp::cmp_privilege(o, &s.origin),744								Some(Ordering::Less) | None745							) {746								return Err(BadOrigin.into());747							}748							// release balance reserve749							// let sender = ensure_signed(750							// 	<<T as Config>::Origin as From<T::PalletsOrigin>>::from(751							// 		origin.unwrap(),752							// 	)753							// 	.into(),754							// )?;755							// let _ = T::CallExecutor::cancel_reserve(id, sender);756757							s.call.ensure_unrequested::<T::PreimageProvider>();758						}759						*s = None;760					}761					Ok(())762				})?;763764				Self::deposit_event(Event::Canceled { when, index });765				Ok(())766			} else {767				Err(Error::<T>::NotFound)?768			}769		})770	}771772	fn do_change_named_priority(773		origin: T::PalletsOrigin,774		id: ScheduledId,775		priority: schedule::Priority,776	) -> DispatchResult {777		match Lookup::<T>::get(id) {778			Some((when, index)) => {779				let i = index as usize;780				Agenda::<T>::try_mutate(when, |agenda| {781					if let Some(Some(s)) = agenda.get_mut(i) {782						if matches!(783							T::OriginPrivilegeCmp::cmp_privilege(&origin, &s.origin),784							Some(Ordering::Less) | None785						) {786							return Err(BadOrigin.into());787						}788789						s.priority = priority;790						Self::deposit_event(Event::PriorityChanged {791							when,792							index,793							priority,794						});795					}796					Ok(())797				})798			}799			None => Err(Error::<T>::NotFound.into()),800		}801	}802}
deletedpallets/scheduler/src/weights.rsdiffbeforeafterboth
--- a/pallets/scheduler/src/weights.rs
+++ /dev/null
@@ -1,369 +0,0 @@
-// Template adopted from https://github.com/paritytech/substrate/blob/master/.maintain/frame-weight-template.hbs
-
-//! Autogenerated weights for pallet_unique_scheduler
-//!
-//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
-//! DATE: 2022-09-14, STEPS: `50`, REPEAT: 80, LOW RANGE: `[]`, HIGH RANGE: `[]`
-//! EXECUTION: None, WASM-EXECUTION: Compiled, CHAIN: None, DB CACHE: 1024
-
-// Executed Command:
-// target/release/unique-collator
-// benchmark
-// pallet
-// --pallet
-// pallet-unique-scheduler
-// --wasm-execution
-// compiled
-// --extrinsic
-// *
-// --template
-// .maintain/frame-weight-template.hbs
-// --steps=50
-// --repeat=80
-// --heap-pages=4096
-// --output=./pallets/scheduler/src/weights.rs
-
-#![cfg_attr(rustfmt, rustfmt_skip)]
-#![allow(unused_parens)]
-#![allow(unused_imports)]
-#![allow(missing_docs)]
-#![allow(clippy::unnecessary_cast)]
-
-use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
-use sp_std::marker::PhantomData;
-
-/// Weight functions needed for pallet_unique_scheduler.
-pub trait WeightInfo {
-	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight;
-	fn on_initialize_named_resolved(s: u32, ) -> Weight;
-	fn on_initialize_periodic(s: u32, ) -> Weight;
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight;
-	fn on_initialize_aborted(s: u32, ) -> Weight;
-	fn on_initialize_named_aborted(s: u32, ) -> Weight;
-	fn on_initialize_named(s: u32, ) -> Weight;
-	fn on_initialize(s: u32, ) -> Weight;
-	fn on_initialize_resolved(s: u32, ) -> Weight;
-	fn schedule_named(s: u32, ) -> Weight;
-	fn cancel_named(s: u32, ) -> Weight;
-	fn change_named_priority(s: u32, ) -> Weight;
-}
-
-/// Weights for pallet_unique_scheduler using the Substrate node and recommended hardware.
-pub struct SubstrateWeight<T>(PhantomData<T>);
-impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(26_641_000)
-			// Standard Error: 9_000
-			.saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(23_941_000)
-			// Standard Error: 17_000
-			.saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		Weight::from_ref_time(24_858_000)
-			// Standard Error: 7_000
-			.saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_515_000)
-			// Standard Error: 14_000
-			.saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_aborted(s: u32, ) -> Weight {
-		Weight::from_ref_time(7_584_000)
-			// Standard Error: 1_000
-			.saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(2 as u64))
-			.saturating_add(T::DbWeight::get().writes(2 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_552_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(8_980_000)
-			// Standard Error: 12_000
-			.saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(2 as u64))
-			.saturating_add(T::DbWeight::get().writes(2 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize(s: u32, ) -> Weight {
-		Weight::from_ref_time(24_482_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_187_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(4 as u64))
-			.saturating_add(T::DbWeight::get().writes(4 as u64))
-			.saturating_add(T::DbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(17_316_000)
-			// Standard Error: 3_000
-			.saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(2 as u64))
-			.saturating_add(T::DbWeight::get().writes(2 as u64))
-	}
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn cancel_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(15_652_000)
-			// Standard Error: 1_000
-			.saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(2 as u64))
-			.saturating_add(T::DbWeight::get().writes(2 as u64))
-	}
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn change_named_priority(s: u32, ) -> Weight {
-		Weight::from_ref_time(8_642_000)
-			// Standard Error: 0
-			.saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64))
-			.saturating_add(T::DbWeight::get().reads(2 as u64))
-			.saturating_add(T::DbWeight::get().writes(2 as u64))
-	}
-}
-
-// For backwards compatibility and tests
-impl WeightInfo for () {
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic_named_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(26_641_000)
-			// Standard Error: 9_000
-			.saturating_add(Weight::from_ref_time(8_547_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(23_941_000)
-			// Standard Error: 17_000
-			.saturating_add(Weight::from_ref_time(5_282_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic(s: u32, ) -> Weight {
-		Weight::from_ref_time(24_858_000)
-			// Standard Error: 7_000
-			.saturating_add(Weight::from_ref_time(8_657_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:1 w:1)
-	fn on_initialize_periodic_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_515_000)
-			// Standard Error: 14_000
-			.saturating_add(Weight::from_ref_time(8_656_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().reads((1 as u64).saturating_mul(s as u64)))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((2 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_aborted(s: u32, ) -> Weight {
-		Weight::from_ref_time(7_584_000)
-			// Standard Error: 1_000
-			.saturating_add(Weight::from_ref_time(2_065_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named_aborted(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_552_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_187_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:2 w:2)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(8_980_000)
-			// Standard Error: 12_000
-			.saturating_add(Weight::from_ref_time(2_050_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize(s: u32, ) -> Weight {
-		Weight::from_ref_time(24_482_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_249_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Agenda (r:1 w:1)
-	// Storage: System Account (r:1 w:1)
-	// Storage: System AllExtrinsicsLen (r:1 w:1)
-	// Storage: System BlockWeight (r:1 w:1)
-	// Storage: Configuration WeightToFeeCoefficientOverride (r:1 w:0)
-	// Storage: TransactionPayment NextFeeMultiplier (r:1 w:0)
-	// Storage: Scheduler Lookup (r:0 w:1)
-	fn on_initialize_resolved(s: u32, ) -> Weight {
-		Weight::from_ref_time(25_187_000)
-			// Standard Error: 4_000
-			.saturating_add(Weight::from_ref_time(5_216_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes(4 as u64))
-			.saturating_add(RocksDbWeight::get().writes((1 as u64).saturating_mul(s as u64)))
-	}
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn schedule_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(17_316_000)
-			// Standard Error: 3_000
-			.saturating_add(Weight::from_ref_time(82_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes(2 as u64))
-	}
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn cancel_named(s: u32, ) -> Weight {
-		Weight::from_ref_time(15_652_000)
-			// Standard Error: 1_000
-			.saturating_add(Weight::from_ref_time(436_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes(2 as u64))
-	}
-
-	// Storage: Scheduler Lookup (r:1 w:1)
-	// Storage: Scheduler Agenda (r:1 w:1)
-	fn change_named_priority(s: u32, ) -> Weight {
-		Weight::from_ref_time(8_642_000)
-			// Standard Error: 0
-			.saturating_add(Weight::from_ref_time(431_000).saturating_mul(s as u64))
-			.saturating_add(RocksDbWeight::get().reads(2 as u64))
-			.saturating_add(RocksDbWeight::get().writes(2 as u64))
-	}
-}
modifiedruntime/common/config/pallets/scheduler.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/scheduler.rs
+++ b/runtime/common/config/pallets/scheduler.rs
@@ -25,7 +25,7 @@
 use codec::Decode;
 use crate::{
 	runtime_common::{scheduler::SchedulerPaymentExecutor, config::substrate::RuntimeBlockWeights},
-	Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, OriginCaller, Balances,
+	Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin, OriginCaller,
 };
 use pallet_unique_scheduler_v2::ScheduledEnsureOriginSuccess;
 use up_common::types::AccountId;
@@ -69,23 +69,6 @@
 		}
 	}
 }
-
-// impl pallet_unique_scheduler::Config for Runtime {
-// 	type RuntimeEvent = RuntimeEvent;
-// 	type RuntimeOrigin = RuntimeOrigin;
-// 	type Currency = Balances;
-// 	type PalletsOrigin = OriginCaller;
-// 	type RuntimeCall = RuntimeCall;
-// 	type MaximumWeight = MaximumSchedulerWeight;
-// 	type ScheduleOrigin = EnsureSignedOrRoot<AccountId>;
-// 	type PrioritySetOrigin = EnsureRoot<AccountId>;
-// 	type MaxScheduledPerBlock = MaxScheduledPerBlock;
-// 	type WeightInfo = ();
-// 	type CallExecutor = SchedulerPaymentExecutor;
-// 	type OriginPrivilegeCmp = EqualOrRootOnly;
-// 	type PreimageProvider = ();
-// 	type NoPreimagePostponement = NoPreimagePostponement;
-// }
 
 impl pallet_unique_scheduler_v2::Config for Runtime {
 	type RuntimeEvent = RuntimeEvent;
modifiedruntime/common/scheduler.rsdiffbeforeafterboth
--- a/runtime/common/scheduler.rs
+++ b/runtime/common/scheduler.rs
@@ -15,25 +15,21 @@
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
 use frame_support::{
-	traits::NamedReservableCurrency,
 	dispatch::{GetDispatchInfo, PostDispatchInfo, DispatchInfo},
 };
 use sp_runtime::{
 	traits::{Dispatchable, Applyable, Member},
 	generic::Era,
 	transaction_validity::TransactionValidityError,
-	DispatchErrorWithPostInfo, DispatchError,
+	DispatchErrorWithPostInfo,
 };
 use codec::Encode;
-use crate::{Runtime, RuntimeCall, RuntimeOrigin, Balances, maintenance};
-use up_common::types::{AccountId, Balance};
+use crate::{Runtime, RuntimeCall, RuntimeOrigin, maintenance};
+use up_common::types::AccountId;
 use fp_self_contained::SelfContainedCall;
 use pallet_unique_scheduler_v2::DispatchCall;
 use pallet_transaction_payment::ChargeTransactionPayment;
 
-// type SponsorshipChargeTransactionPayment =
-// 	pallet_charge_transaction::ChargeTransactionPayment<Runtime>;
-
 /// The SignedExtension to the basic transaction logic.
 pub type SignedExtraScheduler = (
 	frame_system::CheckSpecVersion<Runtime>,
@@ -106,97 +102,3 @@
 		extrinsic.apply::<Runtime>(&dispatch_info, len)
 	}
 }
-
-// impl<T: frame_system::Config + pallet_unique_scheduler::Config, SelfContainedSignedInfo>
-// 	DispatchCall<T, SelfContainedSignedInfo> for SchedulerPaymentExecutor
-// where
-// 	<T as frame_system::Config>::Call: Member
-// 		+ Dispatchable<Origin = Origin, Info = DispatchInfo>
-// 		+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>
-// 		+ GetDispatchInfo
-// 		+ From<frame_system::Call<Runtime>>,
-// 	SelfContainedSignedInfo: Send + Sync + 'static,
-// 	Call: From<<T as frame_system::Config>::Call>
-// 		+ From<<T as pallet_unique_scheduler::Config>::Call>
-// 		+ SelfContainedCall<SignedInfo = SelfContainedSignedInfo>,
-// 	sp_runtime::AccountId32: From<<T as frame_system::Config>::AccountId>,
-// {
-// 	fn dispatch_call(
-// 		signer: Option<<T as frame_system::Config>::AccountId>,
-// 		call: <T as pallet_unique_scheduler::Config>::Call,
-// 	) -> Result<
-// 		Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>,
-// 		TransactionValidityError,
-// 	> {
-// 		let dispatch_info = call.get_dispatch_info();
-// 		let len = call.encoded_size();
-
-// 		let signed = match signer {
-// 			Some(signer) => fp_self_contained::CheckedSignature::Signed(
-// 				signer.clone().into(),
-// 				get_signed_extras(signer.into()),
-// 			),
-// 			None => fp_self_contained::CheckedSignature::Unsigned,
-// 		};
-
-// 		let extrinsic = fp_self_contained::CheckedExtrinsic::<
-// 			AccountId,
-// 			Call,
-// 			SignedExtraScheduler,
-// 			SelfContainedSignedInfo,
-// 		> {
-// 			signed,
-// 			function: call.into(),
-// 		};
-
-// 		extrinsic.apply::<Runtime>(&dispatch_info, len)
-// 	}
-
-// 	fn reserve_balance(
-// 		id: [u8; 16],
-// 		sponsor: <T as frame_system::Config>::AccountId,
-// 		call: <T as pallet_unique_scheduler::Config>::Call,
-// 		count: u32,
-// 	) -> Result<(), DispatchError> {
-// 		let dispatch_info = call.get_dispatch_info();
-// 		let weight: Balance =
-// 			SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0)
-// 				.saturating_mul(count.into());
-
-// 		<Balances as NamedReservableCurrency<AccountId>>::reserve_named(
-// 			&id,
-// 			&(sponsor.into()),
-// 			weight,
-// 		)
-// 	}
-
-// 	fn pay_for_call(
-// 		id: [u8; 16],
-// 		sponsor: <T as frame_system::Config>::AccountId,
-// 		call: <T as pallet_unique_scheduler::Config>::Call,
-// 	) -> Result<u128, DispatchError> {
-// 		let dispatch_info = call.get_dispatch_info();
-// 		let weight: Balance =
-// 			SponsorshipChargeTransactionPayment::traditional_fee(0, &dispatch_info, 0);
-// 		Ok(
-// 			<Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// 				&id,
-// 				&(sponsor.into()),
-// 				weight,
-// 			),
-// 		)
-// 	}
-
-// 	fn cancel_reserve(
-// 		id: [u8; 16],
-// 		sponsor: <T as frame_system::Config>::AccountId,
-// 	) -> Result<u128, DispatchError> {
-// 		Ok(
-// 			<Balances as NamedReservableCurrency<AccountId>>::unreserve_named(
-// 				&id,
-// 				&(sponsor.into()),
-// 				u128::MAX,
-// 			),
-// 		)
-// 	}
-// }
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -41,7 +41,6 @@
     'pallet-unique/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
     'pallet-app-promotion/runtime-benchmarks',
-    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-unique-scheduler-v2/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
@@ -72,7 +71,6 @@
     'cumulus-pallet-dmp-queue/try-runtime',
     'pallet-inflation/try-runtime',
     'pallet-unique/try-runtime',
-    'pallet-unique-scheduler/try-runtime',
     'pallet-configuration/try-runtime',
     'pallet-charge-transaction/try-runtime',
     'pallet-common/try-runtime',
@@ -143,7 +141,6 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unique-scheduler/std',
     'pallet-unique-scheduler-v2/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
@@ -476,7 +473,6 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-unique-scheduler-v2 = { path = '../../pallets/scheduler-v2', default-features = false }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -40,7 +40,6 @@
     'pallet-unique/runtime-benchmarks',
     'pallet-foreign-assets/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
-    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
@@ -70,7 +69,6 @@
     'cumulus-pallet-dmp-queue/try-runtime',
     'pallet-inflation/try-runtime',
     'pallet-unique/try-runtime',
-    'pallet-unique-scheduler/try-runtime',
     'pallet-configuration/try-runtime',
     'pallet-charge-transaction/try-runtime',
     'pallet-common/try-runtime',
@@ -139,7 +137,6 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unique-scheduler/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
     'sp-api/std',
@@ -475,7 +472,6 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -40,7 +40,6 @@
     'pallet-unique/runtime-benchmarks',
     'pallet-foreign-assets/runtime-benchmarks',
     'pallet-inflation/runtime-benchmarks',
-    'pallet-unique-scheduler/runtime-benchmarks',
     'pallet-xcm/runtime-benchmarks',
     'sp-runtime/runtime-benchmarks',
     'xcm-builder/runtime-benchmarks',
@@ -71,7 +70,6 @@
     'cumulus-pallet-dmp-queue/try-runtime',
     'pallet-inflation/try-runtime',
     'pallet-unique/try-runtime',
-    'pallet-unique-scheduler/try-runtime',
     'pallet-configuration/try-runtime',
     'pallet-charge-transaction/try-runtime',
     'pallet-common/try-runtime',
@@ -140,7 +138,6 @@
     'pallet-proxy-rmrk-core/std',
     'pallet-proxy-rmrk-equip/std',
     'pallet-unique/std',
-    'pallet-unique-scheduler/std',
     'pallet-charge-transaction/std',
     'up-data-structs/std',
     'sp-api/std',
@@ -469,7 +466,6 @@
 pallet-nonfungible = { default-features = false, path = "../../pallets/nonfungible" }
 pallet-proxy-rmrk-core = { default-features = false, path = "../../pallets/proxy-rmrk-core", package = "pallet-rmrk-core" }
 pallet-proxy-rmrk-equip = { default-features = false, path = "../../pallets/proxy-rmrk-equip", package = "pallet-rmrk-equip" }
-pallet-unique-scheduler = { path = '../../pallets/scheduler', default-features = false }
 # pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }
 pallet-charge-transaction = { git = "https://github.com/uniquenetwork/pallet-sponsoring", branch = "polkadot-v0.9.30", package = "pallet-template-transaction-payment", default-features = false, version = "3.0.0" }
 pallet-evm-migration = { path = '../../pallets/evm-migration', default-features = false }