git.delta.rocks / unique-network / refs/commits / 716fee23155e

difftreelog

chore remove unique-scheduler leftovers

Yaroslav Bolyukin2023-10-04parent: #13e91d3.patch.diff
in: master

10 files changed

modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,5 @@
 [workspace]
 default-members = ['client/*', 'node/*', 'runtime/opal']
-exclude = ['pallets/scheduler-v2']
 members = [
 	'client/*',
 	'crates/*',
@@ -54,7 +53,6 @@
 pallet-structure = { default-features = false, path = "pallets/structure" }
 pallet-test-utils = { default-features = false, path = "test-pallets/utils" }
 pallet-unique = { path = "pallets/unique", default-features = false }
-# pallet-unique-scheduler-v2 = { path = "pallets/scheduler-v2", default-features = false }
 precompile-utils-macro = { path = "runtime/common/ethereum/precompiles/utils/macro" }
 struct-versioning = { path = "crates/struct-versioning" }
 uc-rpc = { path = "client/rpc" }
modifiedMakefilediffbeforeafterboth
--- a/Makefile
+++ b/Makefile
@@ -128,10 +128,6 @@
 bench-structure:
 	make _bench PALLET=structure
 
-.PHONY: bench-scheduler
-bench-scheduler:
-	make _bench PALLET=unique-scheduler-v2 PALLET_DIR=scheduler-v2
-
 .PHONY: bench-foreign-assets
 bench-foreign-assets:
 	make _bench PALLET=foreign-assets
@@ -157,7 +153,6 @@
 	make _bench PALLET=xcm OUTPUT=./runtime/common/weights/xcm.rs TEMPLATE="--template=.maintain/external-weight-template.hbs"
 
 .PHONY: bench
-# Disabled: bench-scheduler
 bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection bench-identity
 
 .PHONY: check
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -40,9 +40,6 @@
 	Balances, Runtime, RuntimeCall, RuntimeEvent, DECIMALS, TOKEN_SYMBOL, VERSION,
 };
 
-#[cfg(feature = "unique-scheduler")]
-pub mod scheduler;
-
 #[cfg(feature = "foreign-assets")]
 pub mod foreign_asset;
 
deletedruntime/common/config/pallets/scheduler.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/scheduler.rs
+++ /dev/null
@@ -1,88 +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/>.
-
-use core::cmp::Ordering;
-
-use frame_support::{
-	parameter_types,
-	traits::{EnsureOrigin, PrivilegeCmp},
-	weights::Weight,
-};
-use frame_system::{EnsureRoot, RawOrigin};
-use pallet_unique_scheduler_v2::ScheduledEnsureOriginSuccess;
-use parity_scale_codec::Decode;
-use sp_runtime::Perbill;
-use up_common::types::AccountId;
-
-use crate::{
-	runtime_common::{config::substrate::RuntimeBlockWeights, scheduler::SchedulerPaymentExecutor},
-	OriginCaller, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin,
-};
-
-parameter_types! {
-	pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *
-		RuntimeBlockWeights::get().max_block;
-	pub const MaxScheduledPerBlock: u32 = 50;
-
-	pub const NoPreimagePostponement: Option<u32> = Some(10);
-	pub const Preimage: Option<u32> = Some(10);
-}
-
-pub struct EnsureSignedOrRoot<AccountId>(sp_std::marker::PhantomData<AccountId>);
-impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId: Decode>
-	EnsureOrigin<O> for EnsureSignedOrRoot<AccountId>
-{
-	type Success = ScheduledEnsureOriginSuccess<AccountId>;
-	fn try_origin(o: O) -> Result<Self::Success, O> {
-		o.into().and_then(|o| match o {
-			RawOrigin::Root => Ok(ScheduledEnsureOriginSuccess::Root),
-			RawOrigin::Signed(who) => Ok(ScheduledEnsureOriginSuccess::Signed(who)),
-			r => Err(O::from(r)),
-		})
-	}
-}
-
-pub struct EqualOrRootOnly;
-impl PrivilegeCmp<OriginCaller> for EqualOrRootOnly {
-	fn cmp_privilege(left: &OriginCaller, right: &OriginCaller) -> Option<Ordering> {
-		use RawOrigin::*;
-
-		let left = left.clone().try_into().ok()?;
-		let right = right.clone().try_into().ok()?;
-
-		match (left, right) {
-			(Root, Root) => Some(Ordering::Equal),
-			(Root, _) => Some(Ordering::Greater),
-			(_, Root) => Some(Ordering::Less),
-			lr @ _ => (lr.0 == lr.1).then(|| Ordering::Equal),
-		}
-	}
-}
-
-impl pallet_unique_scheduler_v2::Config for Runtime {
-	type RuntimeEvent = RuntimeEvent;
-	type RuntimeOrigin = RuntimeOrigin;
-	type PalletsOrigin = OriginCaller;
-	type RuntimeCall = RuntimeCall;
-	type MaximumWeight = MaximumSchedulerWeight;
-	type ScheduleOrigin = EnsureSignedOrRoot<AccountId>;
-	type OriginPrivilegeCmp = EqualOrRootOnly;
-	type MaxScheduledPerBlock = MaxScheduledPerBlock;
-	type WeightInfo = ();
-	type Preimages = ();
-	type CallExecutor = SchedulerPaymentExecutor;
-	type PrioritySetOrigin = EnsureRoot<AccountId>;
-}
modifiedruntime/common/maintenance.rsdiffbeforeafterboth
--- a/runtime/common/maintenance.rs
+++ b/runtime/common/maintenance.rs
@@ -67,9 +67,6 @@
 				| RuntimeCall::Structure(_)
 				| RuntimeCall::Unique(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
 
-				#[cfg(feature = "unique-scheduler")]
-				RuntimeCall::Scheduler(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
-
 				#[cfg(feature = "app-promotion")]
 				RuntimeCall::AppPromotion(_) => {
 					Err(TransactionValidityError::Invalid(InvalidTransaction::Call))
modifiedruntime/common/mod.rsdiffbeforeafterboth
--- a/runtime/common/mod.rs
+++ b/runtime/common/mod.rs
@@ -23,9 +23,6 @@
 pub mod maintenance;
 pub mod runtime_apis;
 
-#[cfg(feature = "unique-scheduler")]
-pub mod scheduler;
-
 pub mod sponsoring;
 #[allow(missing_docs)]
 pub mod weights;
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -548,9 +548,6 @@
 					#[cfg(feature = "refungible")]
 					list_benchmark!(list, extra, pallet_refungible, Refungible);
 
-					#[cfg(feature = "unique-scheduler")]
-					list_benchmark!(list, extra, pallet_unique_scheduler_v2, Scheduler);
-
 					#[cfg(feature = "collator-selection")]
 					list_benchmark!(list, extra, pallet_collator_selection, CollatorSelection);
 
@@ -613,9 +610,6 @@
 
 					#[cfg(feature = "refungible")]
 					add_benchmark!(params, batches, pallet_refungible, Refungible);
-
-					#[cfg(feature = "unique-scheduler")]
-					add_benchmark!(params, batches, pallet_unique_scheduler_v2, Scheduler);
 
 					#[cfg(feature = "collator-selection")]
 					add_benchmark!(params, batches, pallet_collator_selection, CollatorSelection);
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
before · runtime/opal/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Opal Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'opal-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19default = ['opal-runtime', 'std']20limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']21opal-runtime = [22	'app-promotion',23	'collator-selection',24	'foreign-assets',25	'governance',26	'pallet-test-utils',27	'preimage',28	'refungible',29]30pov-estimate = []31runtime-benchmarks = [32	"pallet-preimage/runtime-benchmarks",33	'cumulus-pallet-parachain-system/runtime-benchmarks',34	'frame-benchmarking',35	'frame-support/runtime-benchmarks',36	'frame-system-benchmarking',37	'frame-system/runtime-benchmarks',38	'pallet-app-promotion/runtime-benchmarks',39	'pallet-balances/runtime-benchmarks',40	'pallet-collator-selection/runtime-benchmarks',41	'pallet-collective/runtime-benchmarks',42	'pallet-common/runtime-benchmarks',43	'pallet-configuration/runtime-benchmarks',44	'pallet-democracy/runtime-benchmarks',45	'pallet-ethereum/runtime-benchmarks',46	'pallet-evm-coder-substrate/runtime-benchmarks',47	'pallet-evm-migration/runtime-benchmarks',48	'pallet-foreign-assets/runtime-benchmarks',49	'pallet-fungible/runtime-benchmarks',50	'pallet-identity/runtime-benchmarks',51	'pallet-inflation/runtime-benchmarks',52	'pallet-maintenance/runtime-benchmarks',53	'pallet-membership/runtime-benchmarks',54	'pallet-nonfungible/runtime-benchmarks',55	'pallet-ranked-collective/runtime-benchmarks',56	'pallet-referenda/runtime-benchmarks',57	'pallet-refungible/runtime-benchmarks',58	'pallet-scheduler/runtime-benchmarks',59	'pallet-structure/runtime-benchmarks',60	'pallet-timestamp/runtime-benchmarks',61	'pallet-unique/runtime-benchmarks',62	'pallet-utility/runtime-benchmarks',63	'pallet-xcm/runtime-benchmarks',64	'sp-runtime/runtime-benchmarks',65	'staging-xcm-builder/runtime-benchmarks',66]67std = [68	'cumulus-pallet-aura-ext/std',69	'cumulus-pallet-parachain-system/std',70	'cumulus-pallet-xcm/std',71	'cumulus-pallet-xcmp-queue/std',72	'cumulus-primitives-core/std',73	'cumulus-primitives-utility/std',74	'frame-executive/std',75	'frame-support/std',76	'frame-system-rpc-runtime-api/std',77	'frame-system/std',78	'frame-try-runtime/std',79	'pallet-aura/std',80	'pallet-balances/std',81	'pallet-collective/std',82	'pallet-democracy/std',83	'pallet-gov-origins/std',84	'pallet-membership/std',85	'pallet-ranked-collective/std',86	'pallet-referenda/std',87	'pallet-scheduler/std',88	'parity-scale-codec/std',89	# 'pallet-contracts/std',90	# 'pallet-contracts-primitives/std',91	# 'pallet-contracts-rpc-runtime-api/std',92	# 'pallet-contract-helpers/std',93	"pallet-authorship/std",94	"pallet-preimage/std",95	"pallet-session/std",96	"pallet-state-trie-migration/std",97	"sp-consensus-aura/std",98	'app-promotion-rpc/std',99	'evm-coder/std',100	'fp-rpc/std',101	'fp-self-contained/std',102	'pallet-app-promotion/std',103	'pallet-balances-adapter/std',104	'pallet-base-fee/std',105	'pallet-charge-transaction/std',106	'pallet-collator-selection/std',107	'pallet-common/std',108	'pallet-configuration/std',109	'pallet-ethereum/std',110	'pallet-evm-coder-substrate/std',111	'pallet-evm-contract-helpers/std',112	'pallet-evm-migration/std',113	'pallet-evm-transaction-payment/std',114	'pallet-evm/std',115	'pallet-fungible/std',116	'pallet-identity/std',117	'pallet-inflation/std',118	'pallet-nonfungible/std',119	'pallet-refungible/std',120	'pallet-structure/std',121	'pallet-sudo/std',122	'pallet-timestamp/std',123	'pallet-transaction-payment-rpc-runtime-api/std',124	'pallet-transaction-payment/std',125	'pallet-treasury/std',126	'pallet-unique/std',127	'pallet-utility/std',128	'parachain-info/std',129	'serde',130	'sp-api/std',131	'sp-block-builder/std',132	'sp-core/std',133	'sp-inherents/std',134	'sp-io/std',135	'sp-offchain/std',136	'sp-runtime/std',137	'sp-session/std',138	'sp-std/std',139	'sp-transaction-pool/std',140	'sp-version/std',141	'staging-xcm-builder/std',142	'staging-xcm-executor/std',143	'staging-xcm/std',144	'up-common/std',145	'up-data-structs/std',146	'up-pov-estimate-rpc/std',147	'up-rpc/std',148	'up-sponsorship/std',149150	"orml-tokens/std",151	"orml-traits/std",152	"orml-vesting/std",153	"orml-xcm-support/std",154	"orml-xtokens/std",155	"pallet-foreign-assets/std",156157	'pallet-maintenance/std',158	'pallet-test-utils?/std',159]160try-runtime = [161	"pallet-authorship/try-runtime",162	"pallet-collator-selection/try-runtime",163	"pallet-identity/try-runtime",164	"pallet-preimage/try-runtime",165	"pallet-session/try-runtime",166	"pallet-state-trie-migration/try-runtime",167	'cumulus-pallet-aura-ext/try-runtime',168	'cumulus-pallet-dmp-queue/try-runtime',169	'cumulus-pallet-parachain-system/try-runtime',170	'cumulus-pallet-xcm/try-runtime',171	'cumulus-pallet-xcmp-queue/try-runtime',172	'fp-self-contained/try-runtime',173	'frame-executive/try-runtime',174	'frame-support/try-runtime',175	'frame-system/try-runtime',176	'frame-try-runtime',177	'frame-try-runtime?/try-runtime',178	'orml-tokens/try-runtime',179	'orml-vesting/try-runtime',180	'orml-xtokens/try-runtime',181	'pallet-app-promotion/try-runtime',182	'pallet-aura/try-runtime',183	'pallet-balances-adapter/try-runtime',184	'pallet-balances/try-runtime',185	'pallet-base-fee/try-runtime',186	'pallet-charge-transaction/try-runtime',187	'pallet-collective/try-runtime',188	'pallet-collective/try-runtime',189	'pallet-common/try-runtime',190	'pallet-configuration/try-runtime',191	'pallet-democracy/try-runtime',192	'pallet-democracy/try-runtime',193	'pallet-ethereum/try-runtime',194	'pallet-evm-coder-substrate/try-runtime',195	'pallet-evm-contract-helpers/try-runtime',196	'pallet-evm-migration/try-runtime',197	'pallet-evm-transaction-payment/try-runtime',198	'pallet-evm/try-runtime',199	'pallet-foreign-assets/try-runtime',200	'pallet-fungible/try-runtime',201	'pallet-gov-origins/try-runtime',202	'pallet-inflation/try-runtime',203	'pallet-maintenance/try-runtime',204	'pallet-membership/try-runtime',205	'pallet-membership/try-runtime',206	'pallet-nonfungible/try-runtime',207	'pallet-ranked-collective/try-runtime',208	'pallet-referenda/try-runtime',209	'pallet-refungible/try-runtime',210	'pallet-scheduler/try-runtime',211	'pallet-scheduler/try-runtime',212	'pallet-structure/try-runtime',213	'pallet-sudo/try-runtime',214	'pallet-test-utils?/try-runtime',215	'pallet-timestamp/try-runtime',216	'pallet-transaction-payment/try-runtime',217	'pallet-treasury/try-runtime',218	'pallet-unique/try-runtime',219	'pallet-utility/try-runtime',220	'pallet-xcm/try-runtime',221	'parachain-info/try-runtime',222]223224app-promotion = []225collator-selection = []226foreign-assets = []227gov-test-timings = []228governance = []229preimage = []230refungible = []231session-test-timings = []232unique-scheduler = []233234################################################################################235# local dependencies236237[dependencies]238cumulus-pallet-aura-ext = { workspace = true }239cumulus-pallet-dmp-queue = { workspace = true }240cumulus-pallet-parachain-system = { workspace = true }241cumulus-pallet-xcm = { workspace = true }242cumulus-pallet-xcmp-queue = { workspace = true }243cumulus-primitives-core = { workspace = true }244cumulus-primitives-timestamp = { workspace = true }245cumulus-primitives-utility = { workspace = true }246frame-executive = { workspace = true }247frame-support = { workspace = true }248frame-system = { workspace = true }249frame-system-rpc-runtime-api = { workspace = true }250orml-tokens = { workspace = true }251orml-traits = { workspace = true }252orml-vesting = { workspace = true }253orml-xcm-support = { workspace = true }254orml-xtokens = { workspace = true }255pallet-aura = { workspace = true }256pallet-authorship = { workspace = true }257pallet-balances = { features = ["insecure_zero_ed"], workspace = true }258pallet-preimage = { workspace = true }259pallet-session = { workspace = true }260pallet-state-trie-migration = { workspace = true }261pallet-sudo = { workspace = true }262pallet-timestamp = { workspace = true }263pallet-transaction-payment = { workspace = true }264pallet-transaction-payment-rpc-runtime-api = { workspace = true }265pallet-treasury = { workspace = true }266pallet-utility = { workspace = true }267pallet-xcm = { workspace = true }268parachain-info = { workspace = true }269parity-scale-codec = { workspace = true }270polkadot-parachain-primitives = { workspace = true }271smallvec = { workspace = true }272sp-api = { workspace = true }273sp-arithmetic = { workspace = true }274sp-block-builder = { workspace = true }275sp-consensus-aura = { workspace = true }276sp-core = { workspace = true }277sp-inherents = { workspace = true }278sp-io = { workspace = true }279sp-offchain = { workspace = true }280sp-runtime = { workspace = true }281sp-session = { workspace = true }282sp-std = { workspace = true }283sp-transaction-pool = { workspace = true }284sp-version = { workspace = true }285staging-xcm = { workspace = true }286staging-xcm-builder = { workspace = true }287staging-xcm-executor = { workspace = true }288289app-promotion-rpc = { workspace = true }290derivative = { workspace = true }291evm-coder = { workspace = true }292fp-evm = { workspace = true }293fp-rpc = { workspace = true }294fp-self-contained = { workspace = true }295log = { workspace = true }296num_enum = { workspace = true }297pallet-app-promotion = { workspace = true }298pallet-balances-adapter = { workspace = true }299pallet-base-fee = { workspace = true }300pallet-charge-transaction = { workspace = true }301pallet-collator-selection = { workspace = true }302pallet-collective = { workspace = true }303pallet-common = { workspace = true }304pallet-configuration = { workspace = true }305pallet-democracy = { workspace = true }306pallet-ethereum = { workspace = true }307pallet-evm = { workspace = true }308pallet-evm-coder-substrate = { workspace = true }309pallet-evm-contract-helpers = { workspace = true }310pallet-evm-migration = { workspace = true }311pallet-evm-precompile-simple = { workspace = true }312pallet-evm-transaction-payment = { workspace = true }313pallet-foreign-assets = { workspace = true }314pallet-fungible = { workspace = true }315pallet-gov-origins = { workspace = true }316pallet-identity = { workspace = true }317pallet-inflation = { workspace = true }318pallet-maintenance = { workspace = true }319pallet-membership = { workspace = true }320pallet-nonfungible = { workspace = true }321pallet-ranked-collective = { workspace = true }322pallet-referenda = { workspace = true }323pallet-refungible = { workspace = true }324pallet-scheduler = { workspace = true }325pallet-structure = { workspace = true }326pallet-unique = { workspace = true }327precompile-utils-macro = { workspace = true }328scale-info = { workspace = true }329up-common = { workspace = true }330up-data-structs = { workspace = true }331up-pov-estimate-rpc = { workspace = true }332up-rpc = { workspace = true }333up-sponsorship = { workspace = true }334335################################################################################336# Optional dependencies337338frame-benchmarking = { workspace = true, optional = true }339frame-system-benchmarking = { workspace = true, optional = true }340frame-try-runtime = { workspace = true, optional = true }341serde = { workspace = true, optional = true }342343################################################################################344# Test dependencies345346pallet-test-utils = { workspace = true, optional = true }347348################################################################################349# Other Dependencies350351hex-literal = { workspace = true }352impl-trait-for-tuples = { workspace = true }353354[build-dependencies]355substrate-wasm-builder = { workspace = true }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -221,7 +221,6 @@
 preimage = []
 refungible = []
 session-test-timings = []
-unique-scheduler = []
 
 ################################################################################
 # local dependencies
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -224,7 +224,6 @@
 preimage = []
 refungible = []
 session-test-timings = []
-unique-scheduler = []
 
 ################################################################################
 # local dependencies