git.delta.rocks / unique-network / refs/commits / 79c3b738b866

difftreelog

feat preimage + execute preimage in maintenance pallet

Fahrrader2023-02-21parent: #8c90034.patch.diff
in: master

13 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5541,6 +5541,7 @@
  "pallet-inflation",
  "pallet-maintenance",
  "pallet-nonfungible",
+ "pallet-preimage",
  "pallet-randomness-collective-flip",
  "pallet-refungible",
  "pallet-session",
@@ -6480,6 +6481,7 @@
  "frame-system",
  "parity-scale-codec",
  "scale-info",
+ "sp-core",
  "sp-std",
 ]
 
@@ -8968,6 +8970,7 @@
  "pallet-inflation",
  "pallet-maintenance",
  "pallet-nonfungible",
+ "pallet-preimage",
  "pallet-randomness-collective-flip",
  "pallet-refungible",
  "pallet-session",
@@ -13198,6 +13201,7 @@
  "pallet-inflation",
  "pallet-maintenance",
  "pallet-nonfungible",
+ "pallet-preimage",
  "pallet-randomness-collective-flip",
  "pallet-refungible",
  "pallet-session",
modifiedCargo.tomldiffbeforeafterboth
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -98,6 +98,7 @@
 pallet-aura = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 pallet-authorship = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+pallet-preimage = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 pallet-randomness-collective-flip = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 pallet-session = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 pallet-sudo = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
modifiedpallets/maintenance/Cargo.tomldiffbeforeafterboth
--- a/pallets/maintenance/Cargo.toml
+++ b/pallets/maintenance/Cargo.toml
@@ -18,10 +18,11 @@
 frame-benchmarking = { workspace = true, optional = true }
 frame-support = { workspace = true }
 frame-system = { workspace = true }
+sp-core = { workspace = true }
 sp-std = { workspace = true }
 
 [features]
 default = ["std"]
 runtime-benchmarks = ["frame-benchmarking", "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks"]
-std = ["codec/std", "frame-benchmarking/std", "frame-support/std", "frame-system/std", "scale-info/std", "sp-std/std"]
+std = ["codec/std", "frame-benchmarking/std", "frame-support/std", "frame-system/std", "scale-info/std", "sp-core/std", "sp-std/std"]
 try-runtime = ["frame-support/try-runtime"]
modifiedpallets/maintenance/src/lib.rsdiffbeforeafterboth
--- a/pallets/maintenance/src/lib.rs
+++ b/pallets/maintenance/src/lib.rs
@@ -25,13 +25,37 @@
 
 #[frame_support::pallet]
 pub mod pallet {
-	use frame_support::pallet_prelude::*;
+	use frame_support::{
+		dispatch::*,
+		pallet_prelude::*,
+		traits::{QueryPreimage, StorePreimage},
+	};
 	use frame_system::pallet_prelude::*;
+	use sp_core::H256;
+
 	use crate::weights::WeightInfo;
 
 	#[pallet::config]
 	pub trait Config: frame_system::Config {
+		/// The overarching event type.
 		type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
+
+		/// The runtime origin type.
+		type RuntimeOrigin: From<RawOrigin<Self::AccountId>>
+			+ IsType<<Self as frame_system::Config>::RuntimeOrigin>;
+
+		/// The aggregated call type.
+		type RuntimeCall: Parameter
+			+ Dispatchable<
+				RuntimeOrigin = <Self as Config>::RuntimeOrigin,
+				PostInfo = PostDispatchInfo,
+			> + GetDispatchInfo
+			+ From<frame_system::Call<Self>>;
+
+		/// The preimage provider with which we look up call hashes to get the call.
+		type Preimages: QueryPreimage + StorePreimage;
+
+		/// Weight information for extrinsics in this pallet.
 		type WeightInfo: WeightInfo;
 	}
 
@@ -78,5 +102,23 @@
 
 			Ok(())
 		}
+
+		#[pallet::call_index(2)]
+		#[pallet::weight(<T as Config>::WeightInfo::execute_preimage())]
+		pub fn execute_preimage(origin: OriginFor<T>, hash: H256) -> DispatchResult {
+			ensure_root(origin)?;
+
+			let len = T::Preimages::len(&hash).ok_or(DispatchError::Unavailable)?;
+			let bounded = T::Preimages::pick::<<T as Config>::RuntimeCall>(hash, len);
+			let (call, _) =
+				T::Preimages::realize(&bounded).map_err(|_| DispatchError::Unavailable)?;
+
+			let result = match call.dispatch(frame_system::RawOrigin::Root.into()) {
+				Ok(_) => Ok(()),
+				Err(error_and_info) => Err(error_and_info.error),
+			};
+
+			result
+		}
 	}
 }
modifiedpallets/scheduler-v2/Cargo.tomldiffbeforeafterboth
--- a/pallets/scheduler-v2/Cargo.toml
+++ b/pallets/scheduler-v2/Cargo.toml
@@ -24,7 +24,7 @@
 sp-std = { workspace = true }
 
 [dev-dependencies]
-pallet-preimage = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
+pallet-preimage = { workspace = true }
 substrate-test-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.37" }
 
 [features]
addedruntime/common/config/pallets/governance.rsdiffbeforeafterboth
--- /dev/null
+++ b/runtime/common/config/pallets/governance.rs
@@ -0,0 +1,34 @@
+// 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 frame_support::parameter_types;
+use frame_system::EnsureRoot;
+use crate::{AccountId, Balance, Balances, Runtime, RuntimeEvent};
+use up_common::constants::*;
+
+parameter_types! {
+	pub PreimageBaseDeposit: Balance = 1000 * UNIQUE; // deposit(2, 64);
+	// pub PreimageByteDeposit: Balance = 1 * CENTIUNIQUE; // deposit(0, 1);
+}
+
+impl pallet_preimage::Config for Runtime {
+	type WeightInfo = pallet_preimage::weights::SubstrateWeight<Runtime>;
+	type RuntimeEvent = RuntimeEvent;
+	type Currency = Balances;
+	type ManagerOrigin = EnsureRoot<AccountId>;
+	type BaseDeposit = PreimageBaseDeposit;
+	type ByteDeposit = TransactionByteFee;
+}
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/mod.rs
+++ b/runtime/common/config/pallets/mod.rs
@@ -23,7 +23,7 @@
 		weights::CommonWeights,
 		RelayChainBlockNumberProvider,
 	},
-	Runtime, RuntimeEvent, RuntimeCall, Balances,
+	Runtime, RuntimeEvent, RuntimeCall, RuntimeOrigin, Balances, Preimage,
 };
 use frame_support::traits::{ConstU32, ConstU64};
 use up_common::{
@@ -47,6 +47,10 @@
 #[cfg(feature = "collator-selection")]
 pub mod collator_selection;
 
+// todo:governance replace the feature with governance
+#[cfg(feature = "collator-selection")]
+pub mod governance;
+
 parameter_types! {
 	pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
 	pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
@@ -123,5 +127,8 @@
 
 impl pallet_maintenance::Config for Runtime {
 	type RuntimeEvent = RuntimeEvent;
+	type RuntimeOrigin = RuntimeOrigin;
+	type RuntimeCall = RuntimeCall;
+	type Preimages = Preimage;
 	type WeightInfo = pallet_maintenance::weights::SubstrateWeight<Self>;
 }
modifiedruntime/common/construct_runtime.rsdiffbeforeafterboth
--- a/runtime/common/construct_runtime.rs
+++ b/runtime/common/construct_runtime.rs
@@ -56,6 +56,10 @@
                 #[cfg(feature = "collator-selection")]
                 Identity: pallet_identity::{Pallet, Call, Storage, Event<T>} = 40,
 
+                // todo:governance switch feature to governance
+                #[cfg(feature = "collator-selection")]
+                Preimage: pallet_preimage::{Pallet, Call, Storage, Event<T>} = 41,
+
                 // XCM helpers.
                 XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
                 PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
modifiedruntime/common/maintenance.rsdiffbeforeafterboth
--- a/runtime/common/maintenance.rs
+++ b/runtime/common/maintenance.rs
@@ -86,6 +86,10 @@
 				| RuntimeCall::Session(_)
 				| RuntimeCall::Identity(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
 
+				// todo:governance switch the feature to governance
+				#[cfg(feature = "collator-selection")]
+				RuntimeCall::Preimage(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
+
 				#[cfg(feature = "pallet-test-utils")]
 				RuntimeCall::TestUtils(_) => Err(TransactionValidityError::Invalid(InvalidTransaction::Call)),
 
modifiedruntime/common/runtime_apis.rsdiffbeforeafterboth
--- a/runtime/common/runtime_apis.rs
+++ b/runtime/common/runtime_apis.rs
@@ -565,6 +565,10 @@
                     #[cfg(feature = "collator-selection")]
                     list_benchmark!(list, extra, pallet_identity, Identity);
 
+                    // todo:governance switch feature to governance
+                    #[cfg(feature = "collator-selection")]
+                    list_benchmark!(list, extra, pallet_preimage, Preimage);
+
                     #[cfg(feature = "foreign-assets")]
                     list_benchmark!(list, extra, pallet_foreign_assets, ForeignAssets);
 
@@ -629,6 +633,10 @@
                     #[cfg(feature = "collator-selection")]
                     add_benchmark!(params, batches, pallet_identity, Identity);
 
+                    // todo:governance switch feature to governance
+                    #[cfg(feature = "collator-selection")]
+                    add_benchmark!(params, batches, pallet_preimage, Preimage);
+
                     #[cfg(feature = "foreign-assets")]
                     add_benchmark!(params, batches, pallet_foreign_assets, ForeignAssets);
 
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -41,6 +41,7 @@
 	'pallet-inflation/runtime-benchmarks',
 	'pallet-maintenance/runtime-benchmarks',
 	'pallet-nonfungible/runtime-benchmarks',
+	"pallet-preimage/runtime-benchmarks",
 	'pallet-refungible/runtime-benchmarks',
 	'pallet-structure/runtime-benchmarks',
 	'pallet-timestamp/runtime-benchmarks',
@@ -69,6 +70,7 @@
 	# 'pallet-contracts-primitives/std',
 	# 'pallet-contracts-rpc-runtime-api/std',
 	# 'pallet-contract-helpers/std',
+	"pallet-preimage/std",
 	"pallet-authorship/std",
 	"pallet-session/std",
 	"sp-consensus-aura/std",
@@ -139,6 +141,7 @@
 	"pallet-collator-selection/try-runtime",
 	"pallet-identity/try-runtime",
 	"pallet-session/try-runtime",
+	"pallet-preimage/try-runtime",
 	'cumulus-pallet-aura-ext/try-runtime',
 	'cumulus-pallet-dmp-queue/try-runtime',
 	'cumulus-pallet-parachain-system/try-runtime',
@@ -218,6 +221,7 @@
 pallet-aura = { workspace = true }
 pallet-authorship = { workspace = true }
 pallet-balances = { workspace = true }
+pallet-preimage = { workspace = true }
 pallet-randomness-collective-flip = { workspace = true }
 pallet-session = { workspace = true }
 pallet-sudo = { workspace = true }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
before · runtime/quartz/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Quartz Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'quartz-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19become-sapphire = []20default = ['quartz-runtime', 'std']21limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']22pov-estimate = []23quartz-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'refungible']24runtime-benchmarks = [25	'cumulus-pallet-parachain-system/runtime-benchmarks',26	'frame-benchmarking',27	'frame-support/runtime-benchmarks',28	'frame-system-benchmarking',29	'frame-system/runtime-benchmarks',30	'hex-literal',31	'pallet-app-promotion/runtime-benchmarks',32	'pallet-balances/runtime-benchmarks',33	'pallet-collator-selection/runtime-benchmarks',34	'pallet-common/runtime-benchmarks',35	'pallet-configuration/runtime-benchmarks',36	'pallet-ethereum/runtime-benchmarks',37	'pallet-evm-coder-substrate/runtime-benchmarks',38	'pallet-evm-migration/runtime-benchmarks',39	'pallet-foreign-assets/runtime-benchmarks',40	'pallet-fungible/runtime-benchmarks',41	'pallet-identity/runtime-benchmarks',42	'pallet-inflation/runtime-benchmarks',43	'pallet-maintenance/runtime-benchmarks',44	'pallet-nonfungible/runtime-benchmarks',45	'pallet-refungible/runtime-benchmarks',46	'pallet-structure/runtime-benchmarks',47	'pallet-timestamp/runtime-benchmarks',48	'pallet-unique/runtime-benchmarks',49	'pallet-xcm/runtime-benchmarks',50	'sp-runtime/runtime-benchmarks',51	'xcm-builder/runtime-benchmarks',52]53std = [54	'codec/std',55	'cumulus-pallet-aura-ext/std',56	'cumulus-pallet-parachain-system/std',57	'cumulus-pallet-xcm/std',58	'cumulus-pallet-xcmp-queue/std',59	'cumulus-primitives-core/std',60	'cumulus-primitives-utility/std',61	'frame-executive/std',62	'frame-support/std',63	'frame-system-rpc-runtime-api/std',64	'frame-system/std',65	'frame-try-runtime/std',66	'pallet-aura/std',67	'pallet-balances/std',68	# 'pallet-contracts/std',69	# 'pallet-contracts-primitives/std',70	# 'pallet-contracts-rpc-runtime-api/std',71	# 'pallet-contract-helpers/std',72	"pallet-authorship/std",73	"pallet-identity/std",74	"pallet-session/std",75	"sp-consensus-aura/std",76	'app-promotion-rpc/std',77	'evm-coder/std',78	'fp-evm-mapping/std',79	'fp-rpc/std',80	'fp-self-contained/std',81	'pallet-app-promotion/std',82	'pallet-base-fee/std',83	'pallet-charge-transaction/std',84	'pallet-collator-selection/std',85	'pallet-common/std',86	'pallet-configuration/std',87	'pallet-ethereum/std',88	'pallet-evm-coder-substrate/std',89	'pallet-evm-contract-helpers/std',90	'pallet-evm-migration/std',91	'pallet-evm-transaction-payment/std',92	'pallet-evm/std',93	'pallet-fungible/std',94	'pallet-inflation/std',95	'pallet-nonfungible/std',96	'pallet-randomness-collective-flip/std',97	'pallet-refungible/std',98	'pallet-structure/std',99	'pallet-sudo/std',100	'pallet-timestamp/std',101	'pallet-transaction-payment-rpc-runtime-api/std',102	'pallet-transaction-payment/std',103	'pallet-treasury/std',104	'pallet-unique/std',105	'parachain-info/std',106	'serde',107	'sp-api/std',108	'sp-block-builder/std',109	'sp-core/std',110	'sp-inherents/std',111	'sp-io/std',112	'sp-offchain/std',113	'sp-runtime/std',114	'sp-session/std',115	'sp-std/std',116	'sp-transaction-pool/std',117	'sp-version/std',118	'up-common/std',119	'up-data-structs/std',120	'up-pov-estimate-rpc/std',121	'up-rpc/std',122	'up-sponsorship/std',123	'xcm-builder/std',124	'xcm-executor/std',125	'xcm/std',126127	"orml-tokens/std",128	"orml-traits/std",129	"orml-vesting/std",130	"orml-xtokens/std",131	"pallet-foreign-assets/std",132	"pallet-maintenance/std",133]134try-runtime = [135	"pallet-authorship/try-runtime",136	"pallet-collator-selection/try-runtime",137	"pallet-identity/try-runtime",138	"pallet-session/try-runtime",139	'cumulus-pallet-aura-ext/try-runtime',140	'cumulus-pallet-dmp-queue/try-runtime',141	'cumulus-pallet-parachain-system/try-runtime',142	'cumulus-pallet-xcm/try-runtime',143	'cumulus-pallet-xcmp-queue/try-runtime',144	'fp-self-contained/try-runtime',145	'frame-executive/try-runtime',146	'frame-support/try-runtime',147	'frame-system/try-runtime',148	'frame-try-runtime',149	'orml-tokens/try-runtime',150	'orml-vesting/try-runtime',151	'orml-xtokens/try-runtime',152	'pallet-app-promotion/try-runtime',153	'pallet-aura/try-runtime',154	'pallet-balances/try-runtime',155	'pallet-charge-transaction/try-runtime',156	'pallet-common/try-runtime',157	'pallet-configuration/try-runtime',158	'pallet-ethereum/try-runtime',159	'pallet-evm-coder-substrate/try-runtime',160	'pallet-evm-contract-helpers/try-runtime',161	'pallet-evm-migration/try-runtime',162	'pallet-evm-transaction-payment/try-runtime',163	'pallet-evm/try-runtime',164	'pallet-foreign-assets/try-runtime',165	'pallet-fungible/try-runtime',166	'pallet-inflation/try-runtime',167	'pallet-maintenance/try-runtime',168	'pallet-nonfungible/try-runtime',169	'pallet-randomness-collective-flip/try-runtime',170	'pallet-refungible/try-runtime',171	'pallet-structure/try-runtime',172	'pallet-sudo/try-runtime',173	'pallet-timestamp/try-runtime',174	'pallet-transaction-payment/try-runtime',175	'pallet-treasury/try-runtime',176	'pallet-unique/try-runtime',177	'pallet-xcm/try-runtime',178	'parachain-info/try-runtime',179]180181app-promotion = []182collator-selection = []183foreign-assets = []184refungible = []185scheduler = []186187################################################################################188# local dependencies189190[dependencies]191# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.192codec = { workspace = true, package = "parity-scale-codec" }193194cumulus-pallet-aura-ext = { workspace = true }195cumulus-pallet-dmp-queue = { workspace = true }196cumulus-pallet-parachain-system = { workspace = true }197cumulus-pallet-xcm = { workspace = true }198cumulus-pallet-xcmp-queue = { workspace = true }199cumulus-primitives-core = { workspace = true }200cumulus-primitives-timestamp = { workspace = true }201cumulus-primitives-utility = { workspace = true }202frame-executive = { workspace = true }203frame-support = { workspace = true }204frame-system = { workspace = true }205frame-system-rpc-runtime-api = { workspace = true }206orml-tokens = { workspace = true }207orml-traits = { workspace = true }208orml-vesting = { workspace = true }209orml-xtokens = { workspace = true }210pallet-aura = { workspace = true }211pallet-authorship = { workspace = true }212pallet-balances = { workspace = true }213pallet-randomness-collective-flip = { workspace = true }214pallet-session = { workspace = true }215pallet-sudo = { workspace = true }216pallet-timestamp = { workspace = true }217pallet-transaction-payment = { workspace = true }218pallet-transaction-payment-rpc-runtime-api = { workspace = true }219pallet-treasury = { workspace = true }220pallet-xcm = { workspace = true }221parachain-info = { workspace = true }222polkadot-parachain = { workspace = true }223smallvec = { workspace = true }224sp-api = { workspace = true }225sp-arithmetic = { workspace = true }226sp-block-builder = { workspace = true }227sp-consensus-aura = { workspace = true }228sp-core = { workspace = true }229sp-inherents = { workspace = true }230sp-io = { workspace = true }231sp-offchain = { workspace = true }232sp-runtime = { workspace = true }233sp-session = { workspace = true }234sp-std = { workspace = true }235sp-transaction-pool = { workspace = true }236sp-version = { workspace = true }237xcm = { workspace = true }238xcm-builder = { workspace = true }239xcm-executor = { workspace = true }240241app-promotion-rpc = { workspace = true }242derivative = { workspace = true }243fp-evm = { workspace = true }244fp-evm-mapping = { workspace = true }245log = { workspace = true }246pallet-app-promotion = { workspace = true }247pallet-collator-selection = { workspace = true }248pallet-common = { workspace = true }249pallet-configuration = { workspace = true }250pallet-fungible = { workspace = true }251pallet-identity = { workspace = true }252pallet-inflation = { workspace = true }253pallet-nonfungible = { workspace = true }254pallet-refungible = { workspace = true }255pallet-structure = { workspace = true }256pallet-unique = { workspace = true }257scale-info = { workspace = true }258up-common = { workspace = true }259up-data-structs = { workspace = true }260up-pov-estimate-rpc = { workspace = true }261up-rpc = { workspace = true }262# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }263evm-coder = { workspace = true }264fp-rpc = { workspace = true }265fp-self-contained = { workspace = true }266num_enum = { version = "0.5.3", default-features = false }267pallet-base-fee = { workspace = true }268pallet-charge-transaction = { workspace = true }269pallet-ethereum = { workspace = true }270pallet-evm = { workspace = true }271pallet-evm-coder-substrate = { workspace = true }272pallet-evm-contract-helpers = { workspace = true }273pallet-evm-migration = { workspace = true }274pallet-evm-precompile-simple = { workspace = true }275pallet-evm-transaction-payment = { workspace = true }276pallet-foreign-assets = { workspace = true }277pallet-maintenance = { workspace = true }278precompile-utils-macro = { workspace = true }279up-sponsorship = { workspace = true }280281################################################################################282# Optional dependencies283284frame-system-benchmarking = { workspace = true, optional = true }285frame-benchmarking = { workspace = true, optional = true }286frame-try-runtime = { workspace = true, optional = true }287serde = { workspace = true, optional = true }288hex-literal = { workspace = true, optional = true }289290291################################################################################292# Test dependencies293294pallet-test-utils = { workspace = true }295296################################################################################297# Other Dependencies298299impl-trait-for-tuples = { workspace = true }300301[dev-dependencies]302logtest = { workspace = true }303304[build-dependencies]305substrate-wasm-builder = { workspace = true }
after · runtime/quartz/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6build = 'build.rs'7description = 'Quartz Runtime'8edition = '2021'9homepage = 'https://unique.network'10license = 'GPLv3'11name = 'quartz-runtime'12repository = 'https://github.com/UniqueNetwork/unique-chain'13version.workspace = true1415[package.metadata.docs.rs]16targets = ['x86_64-unknown-linux-gnu']1718[features]19become-sapphire = []20default = ['quartz-runtime', 'std']21limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']22pov-estimate = []23quartz-runtime = ['app-promotion', 'collator-selection', 'foreign-assets', 'refungible']24runtime-benchmarks = [25	'cumulus-pallet-parachain-system/runtime-benchmarks',26	'frame-benchmarking',27	'frame-support/runtime-benchmarks',28	'frame-system-benchmarking',29	'frame-system/runtime-benchmarks',30	'hex-literal',31	'pallet-app-promotion/runtime-benchmarks',32	'pallet-balances/runtime-benchmarks',33	'pallet-collator-selection/runtime-benchmarks',34	'pallet-common/runtime-benchmarks',35	'pallet-configuration/runtime-benchmarks',36	'pallet-ethereum/runtime-benchmarks',37	'pallet-evm-coder-substrate/runtime-benchmarks',38	'pallet-evm-migration/runtime-benchmarks',39	'pallet-foreign-assets/runtime-benchmarks',40	'pallet-fungible/runtime-benchmarks',41	'pallet-identity/runtime-benchmarks',42	'pallet-inflation/runtime-benchmarks',43	'pallet-maintenance/runtime-benchmarks',44	'pallet-nonfungible/runtime-benchmarks',45	"pallet-preimage/runtime-benchmarks",46	'pallet-refungible/runtime-benchmarks',47	'pallet-structure/runtime-benchmarks',48	'pallet-timestamp/runtime-benchmarks',49	'pallet-unique/runtime-benchmarks',50	'pallet-xcm/runtime-benchmarks',51	'sp-runtime/runtime-benchmarks',52	'xcm-builder/runtime-benchmarks',53]54std = [55	'codec/std',56	'cumulus-pallet-aura-ext/std',57	'cumulus-pallet-parachain-system/std',58	'cumulus-pallet-xcm/std',59	'cumulus-pallet-xcmp-queue/std',60	'cumulus-primitives-core/std',61	'cumulus-primitives-utility/std',62	'frame-executive/std',63	'frame-support/std',64	'frame-system-rpc-runtime-api/std',65	'frame-system/std',66	'frame-try-runtime/std',67	'pallet-aura/std',68	'pallet-balances/std',69	# 'pallet-contracts/std',70	# 'pallet-contracts-primitives/std',71	# 'pallet-contracts-rpc-runtime-api/std',72	# 'pallet-contract-helpers/std',73	"pallet-preimage/std",74	"pallet-authorship/std",75	"pallet-identity/std",76	"pallet-session/std",77	"sp-consensus-aura/std",78	'app-promotion-rpc/std',79	'evm-coder/std',80	'fp-evm-mapping/std',81	'fp-rpc/std',82	'fp-self-contained/std',83	'pallet-app-promotion/std',84	'pallet-base-fee/std',85	'pallet-charge-transaction/std',86	'pallet-collator-selection/std',87	'pallet-common/std',88	'pallet-configuration/std',89	'pallet-ethereum/std',90	'pallet-evm-coder-substrate/std',91	'pallet-evm-contract-helpers/std',92	'pallet-evm-migration/std',93	'pallet-evm-transaction-payment/std',94	'pallet-evm/std',95	'pallet-fungible/std',96	'pallet-inflation/std',97	'pallet-nonfungible/std',98	'pallet-randomness-collective-flip/std',99	'pallet-refungible/std',100	'pallet-structure/std',101	'pallet-sudo/std',102	'pallet-timestamp/std',103	'pallet-transaction-payment-rpc-runtime-api/std',104	'pallet-transaction-payment/std',105	'pallet-treasury/std',106	'pallet-unique/std',107	'parachain-info/std',108	'serde',109	'sp-api/std',110	'sp-block-builder/std',111	'sp-core/std',112	'sp-inherents/std',113	'sp-io/std',114	'sp-offchain/std',115	'sp-runtime/std',116	'sp-session/std',117	'sp-std/std',118	'sp-transaction-pool/std',119	'sp-version/std',120	'up-common/std',121	'up-data-structs/std',122	'up-pov-estimate-rpc/std',123	'up-rpc/std',124	'up-sponsorship/std',125	'xcm-builder/std',126	'xcm-executor/std',127	'xcm/std',128129	"orml-tokens/std",130	"orml-traits/std",131	"orml-vesting/std",132	"orml-xtokens/std",133	"pallet-foreign-assets/std",134	"pallet-maintenance/std",135]136try-runtime = [137	"pallet-authorship/try-runtime",138	"pallet-collator-selection/try-runtime",139	"pallet-identity/try-runtime",140	"pallet-session/try-runtime",141	"pallet-preimage/try-runtime",142	'cumulus-pallet-aura-ext/try-runtime',143	'cumulus-pallet-dmp-queue/try-runtime',144	'cumulus-pallet-parachain-system/try-runtime',145	'cumulus-pallet-xcm/try-runtime',146	'cumulus-pallet-xcmp-queue/try-runtime',147	'fp-self-contained/try-runtime',148	'frame-executive/try-runtime',149	'frame-support/try-runtime',150	'frame-system/try-runtime',151	'frame-try-runtime',152	'orml-tokens/try-runtime',153	'orml-vesting/try-runtime',154	'orml-xtokens/try-runtime',155	'pallet-app-promotion/try-runtime',156	'pallet-aura/try-runtime',157	'pallet-balances/try-runtime',158	'pallet-charge-transaction/try-runtime',159	'pallet-common/try-runtime',160	'pallet-configuration/try-runtime',161	'pallet-ethereum/try-runtime',162	'pallet-evm-coder-substrate/try-runtime',163	'pallet-evm-contract-helpers/try-runtime',164	'pallet-evm-migration/try-runtime',165	'pallet-evm-transaction-payment/try-runtime',166	'pallet-evm/try-runtime',167	'pallet-foreign-assets/try-runtime',168	'pallet-fungible/try-runtime',169	'pallet-inflation/try-runtime',170	'pallet-maintenance/try-runtime',171	'pallet-nonfungible/try-runtime',172	'pallet-randomness-collective-flip/try-runtime',173	'pallet-refungible/try-runtime',174	'pallet-structure/try-runtime',175	'pallet-sudo/try-runtime',176	'pallet-timestamp/try-runtime',177	'pallet-transaction-payment/try-runtime',178	'pallet-treasury/try-runtime',179	'pallet-unique/try-runtime',180	'pallet-xcm/try-runtime',181	'parachain-info/try-runtime',182]183184app-promotion = []185collator-selection = []186foreign-assets = []187refungible = []188scheduler = []189190################################################################################191# local dependencies192193[dependencies]194# Note: `package = "parity-scale-codec"` must be supplied since the `Encode` macro searches for it.195codec = { workspace = true, package = "parity-scale-codec" }196197cumulus-pallet-aura-ext = { workspace = true }198cumulus-pallet-dmp-queue = { workspace = true }199cumulus-pallet-parachain-system = { workspace = true }200cumulus-pallet-xcm = { workspace = true }201cumulus-pallet-xcmp-queue = { workspace = true }202cumulus-primitives-core = { workspace = true }203cumulus-primitives-timestamp = { workspace = true }204cumulus-primitives-utility = { workspace = true }205frame-executive = { workspace = true }206frame-support = { workspace = true }207frame-system = { workspace = true }208frame-system-rpc-runtime-api = { workspace = true }209orml-tokens = { workspace = true }210orml-traits = { workspace = true }211orml-vesting = { workspace = true }212orml-xtokens = { workspace = true }213pallet-aura = { workspace = true }214pallet-authorship = { workspace = true }215pallet-balances = { workspace = true }216pallet-preimage = { workspace = true }217pallet-randomness-collective-flip = { workspace = true }218pallet-session = { workspace = true }219pallet-sudo = { workspace = true }220pallet-timestamp = { workspace = true }221pallet-transaction-payment = { workspace = true }222pallet-transaction-payment-rpc-runtime-api = { workspace = true }223pallet-treasury = { workspace = true }224pallet-xcm = { workspace = true }225parachain-info = { workspace = true }226polkadot-parachain = { workspace = true }227smallvec = { workspace = true }228sp-api = { workspace = true }229sp-arithmetic = { workspace = true }230sp-block-builder = { workspace = true }231sp-consensus-aura = { workspace = true }232sp-core = { workspace = true }233sp-inherents = { workspace = true }234sp-io = { workspace = true }235sp-offchain = { workspace = true }236sp-runtime = { workspace = true }237sp-session = { workspace = true }238sp-std = { workspace = true }239sp-transaction-pool = { workspace = true }240sp-version = { workspace = true }241xcm = { workspace = true }242xcm-builder = { workspace = true }243xcm-executor = { workspace = true }244245app-promotion-rpc = { workspace = true }246derivative = { workspace = true }247fp-evm = { workspace = true }248fp-evm-mapping = { workspace = true }249log = { workspace = true }250pallet-app-promotion = { workspace = true }251pallet-collator-selection = { workspace = true }252pallet-common = { workspace = true }253pallet-configuration = { workspace = true }254pallet-fungible = { workspace = true }255pallet-identity = { workspace = true }256pallet-inflation = { workspace = true }257pallet-nonfungible = { workspace = true }258pallet-refungible = { workspace = true }259pallet-structure = { workspace = true }260pallet-unique = { workspace = true }261scale-info = { workspace = true }262up-common = { workspace = true }263up-data-structs = { workspace = true }264up-pov-estimate-rpc = { workspace = true }265up-rpc = { workspace = true }266# pallet-contract-helpers = { path = '../pallets/contract-helpers', default-features = false, version = '0.1.0' }267evm-coder = { workspace = true }268fp-rpc = { workspace = true }269fp-self-contained = { workspace = true }270num_enum = { version = "0.5.3", default-features = false }271pallet-base-fee = { workspace = true }272pallet-charge-transaction = { workspace = true }273pallet-ethereum = { workspace = true }274pallet-evm = { workspace = true }275pallet-evm-coder-substrate = { workspace = true }276pallet-evm-contract-helpers = { workspace = true }277pallet-evm-migration = { workspace = true }278pallet-evm-precompile-simple = { workspace = true }279pallet-evm-transaction-payment = { workspace = true }280pallet-foreign-assets = { workspace = true }281pallet-maintenance = { workspace = true }282precompile-utils-macro = { workspace = true }283up-sponsorship = { workspace = true }284285################################################################################286# Optional dependencies287288frame-system-benchmarking = { workspace = true, optional = true }289frame-benchmarking = { workspace = true, optional = true }290frame-try-runtime = { workspace = true, optional = true }291serde = { workspace = true, optional = true }292hex-literal = { workspace = true, optional = true }293294295################################################################################296# Test dependencies297298pallet-test-utils = { workspace = true }299300################################################################################301# Other Dependencies302303impl-trait-for-tuples = { workspace = true }304305[dev-dependencies]306logtest = { workspace = true }307308[build-dependencies]309substrate-wasm-builder = { workspace = true }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -39,6 +39,7 @@
 	'pallet-inflation/runtime-benchmarks',
 	'pallet-maintenance/runtime-benchmarks',
 	'pallet-nonfungible/runtime-benchmarks',
+	"pallet-preimage/runtime-benchmarks",
 	'pallet-refungible/runtime-benchmarks',
 	'pallet-structure/runtime-benchmarks',
 	'pallet-timestamp/runtime-benchmarks',
@@ -67,6 +68,7 @@
 	# 'pallet-contracts-primitives/std',
 	# 'pallet-contracts-rpc-runtime-api/std',
 	# 'pallet-contract-helpers/std',
+	"pallet-preimage/std",
 	"pallet-authorship/std",
 	"pallet-identity/std",
 	"pallet-session/std",
@@ -134,6 +136,7 @@
 	"pallet-collator-selection/try-runtime",
 	"pallet-identity/try-runtime",
 	"pallet-session/try-runtime",
+	"pallet-preimage/try-runtime",
 	'cumulus-pallet-aura-ext/try-runtime',
 	'cumulus-pallet-dmp-queue/try-runtime',
 	'cumulus-pallet-parachain-system/try-runtime',
@@ -209,6 +212,7 @@
 pallet-aura = { workspace = true }
 pallet-authorship = { workspace = true }
 pallet-balances = { workspace = true }
+pallet-preimage = { workspace = true }
 pallet-randomness-collective-flip = { workspace = true }
 pallet-session = { workspace = true }
 pallet-sudo = { workspace = true }