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

difftreelog

feat common construct_runtime, rmrk feature

Daniel Shiposha2022-08-01parent: #061bbd8.patch.diff
in: master

9 files changed

modifiedruntime/common/Cargo.tomldiffbeforeafterboth
--- a/runtime/common/Cargo.toml
+++ b/runtime/common/Cargo.toml
@@ -32,8 +32,10 @@
     'frame-support/runtime-benchmarks',
     'frame-system/runtime-benchmarks',
 ]
+
+opal-runtime = []
+quartz-runtime = []
 unique-runtime = []
-quartz-runtime = []
 
 refungible = []
 
modifiedruntime/common/src/lib.rsdiffbeforeafterboth
--- a/runtime/common/src/lib.rs
+++ b/runtime/common/src/lib.rs
@@ -23,3 +23,4 @@
 pub mod sponsoring;
 pub mod types;
 pub mod weights;
+pub mod construct_runtime;
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
154 }154 }
155 }155 }
156
157 impl rmrk_rpc::RmrkApi<
158 Block,
159 AccountId,
160 RmrkCollectionInfo<AccountId>,
161 RmrkInstanceInfo<AccountId>,
162 RmrkResourceInfo,
163 RmrkPropertyInfo,
164 RmrkBaseInfo<AccountId>,
165 RmrkPartType,
166 RmrkTheme
167 > for Runtime {
168 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
169 #[cfg(feature = "rmrk")]
170 return pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>();
171
172 #[cfg(not(feature = "rmrk"))]
173 return Ok(Default::default());
174 }
175
176 fn collection_by_id(
177 #[allow(unused_variables)]
178 collection_id: RmrkCollectionId
179 ) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
180 #[cfg(feature = "rmrk")]
181 return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);
182
183 #[cfg(not(feature = "rmrk"))]
184 return Ok(Default::default())
185 }
186
187 fn nft_by_id(
188 #[allow(unused_variables)]
189 collection_id: RmrkCollectionId,
190
191 #[allow(unused_variables)]
192 nft_by_id: RmrkNftId
193 ) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
194 #[cfg(feature = "rmrk")]
195 return pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id);
196
197 #[cfg(not(feature = "rmrk"))]
198 return Ok(Default::default())
199 }
200
201 fn account_tokens(
202 #[allow(unused_variables)]
203 account_id: AccountId,
204
205 #[allow(unused_variables)]
206 collection_id: RmrkCollectionId
207 ) -> Result<Vec<RmrkNftId>, DispatchError> {
208 #[cfg(feature = "rmrk")]
209 return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);
210
211 #[cfg(not(feature = "rmrk"))]
212 return Ok(Default::default())
213 }
214
215 fn nft_children(
216 #[allow(unused_variables)]
217 collection_id: RmrkCollectionId,
218
219 #[allow(unused_variables)]
220 nft_id: RmrkNftId
221 ) -> Result<Vec<RmrkNftChild>, DispatchError> {
222 #[cfg(feature = "rmrk")]
223 return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);
224
225 #[cfg(not(feature = "rmrk"))]
226 return Ok(Default::default())
227 }
228
229 fn collection_properties(
230 #[allow(unused_variables)]
231 collection_id: RmrkCollectionId,
232
233 #[allow(unused_variables)]
234 filter_keys: Option<Vec<RmrkPropertyKey>>
235 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
236 #[cfg(feature = "rmrk")]
237 return pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys);
238
239 #[cfg(not(feature = "rmrk"))]
240 return Ok(Default::default())
241 }
242
243 fn nft_properties(
244 #[allow(unused_variables)]
245 collection_id: RmrkCollectionId,
246
247 #[allow(unused_variables)]
248 nft_id: RmrkNftId,
249
250 #[allow(unused_variables)]
251 filter_keys: Option<Vec<RmrkPropertyKey>>
252 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
253 #[cfg(feature = "rmrk")]
254 return pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys);
255
256 #[cfg(not(feature = "rmrk"))]
257 return Ok(Default::default())
258 }
259
260 fn nft_resources(
261 #[allow(unused_variables)]
262 collection_id: RmrkCollectionId,
263
264 #[allow(unused_variables)]
265 nft_id: RmrkNftId
266 ) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
267 #[cfg(feature = "rmrk")]
268 return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);
269
270 #[cfg(not(feature = "rmrk"))]
271 return Ok(Default::default())
272 }
273
274 fn nft_resource_priority(
275 #[allow(unused_variables)]
276 collection_id: RmrkCollectionId,
277
278 #[allow(unused_variables)]
279 nft_id: RmrkNftId,
280
281 #[allow(unused_variables)]
282 resource_id: RmrkResourceId
283 ) -> Result<Option<u32>, DispatchError> {
284 #[cfg(feature = "rmrk")]
285 return pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id);
286
287 #[cfg(not(feature = "rmrk"))]
288 return Ok(Default::default())
289 }
290
291 fn base(
292 #[allow(unused_variables)]
293 base_id: RmrkBaseId
294 ) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
295 #[cfg(feature = "rmrk")]
296 return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);
297
298 #[cfg(not(feature = "rmrk"))]
299 return Ok(Default::default())
300 }
301
302 fn base_parts(
303 #[allow(unused_variables)]
304 base_id: RmrkBaseId
305 ) -> Result<Vec<RmrkPartType>, DispatchError> {
306 #[cfg(feature = "rmrk")]
307 return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);
308
309 #[cfg(not(feature = "rmrk"))]
310 return Ok(Default::default())
311 }
312
313 fn theme_names(
314 #[allow(unused_variables)]
315 base_id: RmrkBaseId
316 ) -> Result<Vec<RmrkThemeName>, DispatchError> {
317 #[cfg(feature = "rmrk")]
318 return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);
319
320 #[cfg(not(feature = "rmrk"))]
321 Ok(Default::default())
322 }
323
324 fn theme(
325 #[allow(unused_variables)]
326 base_id: RmrkBaseId,
327
328 #[allow(unused_variables)]
329 theme_name: RmrkThemeName,
330
331 #[allow(unused_variables)]
332 filter_keys: Option<Vec<RmrkPropertyKey>>
333 ) -> Result<Option<RmrkTheme>, DispatchError> {
334 #[cfg(feature = "rmrk")]
335 return pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys);
336
337 #[cfg(not(feature = "rmrk"))]
338 return Ok(Default::default())
339 }
340 }
156341
157 impl sp_api::Core<Block> for Runtime {342 impl sp_api::Core<Block> for Runtime {
158 fn version() -> RuntimeVersion {343 fn version() -> RuntimeVersion {
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
--- a/runtime/opal/Cargo.toml
+++ b/runtime/opal/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'opal-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -119,9 +119,9 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = [
-    'unique-runtime-common/refungible',
-]
+opal-runtime = ['rmrk']
+
+rmrk = []
 
 ################################################################################
 # Substrate Dependencies
@@ -399,7 +399,7 @@
 
 [dependencies]
 log = { version = "0.4.16", default-features = false }
-unique-runtime-common = { path = "../common", default-features = false }
+unique-runtime-common = { path = "../common", default-features = false, features = ['refungible'] }
 scale-info = { version = "2.0.1", default-features = false, features = [
     "derive",
 ] }
modifiedruntime/opal/src/lib.rsdiffbeforeafterboth
--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -130,6 +130,7 @@
 //use xcm_executor::traits::MatchesFungible;
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -910,11 +911,13 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
+#[cfg(feature = "rmrk")]
 impl pallet_proxy_rmrk_core::Config for Runtime {
 	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
 	type Event = Event;
 }
 
+#[cfg(feature = "rmrk")]
 impl pallet_proxy_rmrk_equip::Config for Runtime {
 	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
 	type Event = Event;
@@ -1120,60 +1123,7 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
-
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-		RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
-		RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
+construct_runtime!();
 
 pub struct TransactionConverter;
 
@@ -1309,73 +1259,7 @@
 	}};
 }
 
-impl_common_runtime_apis! {
-	#![custom_apis]
-
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
-		}
-
-		fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)
-		}
-
-		fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)
-		}
-
-		fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)
-		}
-
-		fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)
-		}
-
-		fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)
-		}
-
-		fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)
-		}
-
-		fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)
-		}
-
-		fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)
-		}
-
-		fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
-		}
-
-		fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
-		}
-
-		fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
-		}
-
-		fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)
-		}
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;
 
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'quartz-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -118,7 +118,9 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = []
+quartz-runtime = []
+
+rmrk = []
 
 ################################################################################
 # Substrate Dependencies
modifiedruntime/quartz/src/lib.rsdiffbeforeafterboth
--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -128,6 +128,7 @@
 use xcm_executor::traits::{MatchesFungible, WeightTrader};
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -909,15 +910,17 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
-// impl pallet_proxy_rmrk_core::Config for Runtime {
-// 	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
-// 	type Event = Event;
-// }
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_core::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
 
-// impl pallet_proxy_rmrk_equip::Config for Runtime {
-// 	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
-// 	type Event = Event;
-// }
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_equip::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
 
 impl pallet_unique::Config for Runtime {
 	type Event = Event;
@@ -1118,61 +1121,8 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
+construct_runtime!();
 
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		// Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		// Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-		// RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
-		// RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
-
 pub struct TransactionConverter;
 
 impl fp_rpc::ConvertTransaction<UncheckedExtrinsic> for TransactionConverter {
@@ -1308,129 +1258,8 @@
 		Ok::<_, DispatchError>(dispatch.$method($($name),*))
 	}};
 }
-
-impl_common_runtime_apis! {
-	#![custom_apis]
 
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		
-		// fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
-		// }
-
-		// fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)
-		// }
-
-		// fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)
-		// }
-
-		// fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)
-		// }
-
-		// fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)
-		// }
-
-		// fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)
-		// }
-
-		// fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)
-		// }
-
-		// fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)
-		// }
-
-		// fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-		// 	pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)
-		// }
-
-		// fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
-		// }
-
-		// fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
-		// }
-
-		// fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
-		// }
-
-		// fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-		// 	pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)
-		// }
-		
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			Ok(Default::default())
-		}
-		
-		
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;
 
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -16,7 +16,7 @@
 targets = ['x86_64-unknown-linux-gnu']
 
 [features]
-default = ['std', 'new-functionality']
+default = ['std', 'unique-runtime']
 runtime-benchmarks = [
     'hex-literal',
     'frame-benchmarking',
@@ -119,7 +119,7 @@
     "orml-vesting/std",
 ]
 limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
-new-functionality = []
+unique-runtime = []
 
 ################################################################################
 # Substrate Dependencies
modifiedruntime/unique/src/lib.rsdiffbeforeafterboth
--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -54,7 +54,7 @@
 	OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
 };
 pub use frame_support::{
-	construct_runtime, match_types,
+	match_types,
 	dispatch::DispatchResult,
 	PalletId, parameter_types, StorageValue, ConsensusEngineId,
 	traits::{
@@ -128,6 +128,7 @@
 use xcm_executor::traits::{MatchesFungible, WeightTrader};
 
 use unique_runtime_common::{
+	construct_runtime,
 	impl_common_runtime_apis,
 	types::*,
 	constants::*,
@@ -910,6 +911,18 @@
 	type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
 }
 
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_core::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
+
+#[cfg(feature = "rmrk")]
+impl pallet_proxy_rmrk_equip::Config for Runtime {
+	type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
+	type Event = Event;
+}
+
 impl pallet_unique::Config for Runtime {
 	type Event = Event;
 	type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;
@@ -1109,58 +1122,7 @@
 	type DefaultSponsoringRateLimit = DefaultSponsoringRateLimit;
 }
 
-construct_runtime!(
-	pub enum Runtime where
-		Block = Block,
-		NodeBlock = opaque::Block,
-		UncheckedExtrinsic = UncheckedExtrinsic
-	{
-		ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
-		ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
-
-		Aura: pallet_aura::{Pallet, Config<T>} = 22,
-		AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
-
-		Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
-		RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
-		Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
-		TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
-		Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
-		Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
-		System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
-		Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
-		// Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
-		// Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
-
-		// XCM helpers.
-		XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
-		PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
-		CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
-		DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
-
-		// Unique Pallets
-		Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
-		Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
-		// Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
-		// free = 63
-		Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
-		// ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
-		Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
-		Fungible: pallet_fungible::{Pallet, Storage} = 67,
-		// Refungible: pallet_refungible::{Pallet, Storage} = 68,
-		Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
-		Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
-
-		// Frontier
-		EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
-		Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
-
-		EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
-		EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
-		EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
-		EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
-	}
-);
+construct_runtime!();
 
 pub struct TransactionConverter;
 
@@ -1297,73 +1259,7 @@
 	}};
 }
 
-impl_common_runtime_apis! {
-	#![custom_apis]
-
-	impl rmrk_rpc::RmrkApi<
-		Block,
-		AccountId,
-		RmrkCollectionInfo<AccountId>,
-		RmrkInstanceInfo<AccountId>,
-		RmrkResourceInfo,
-		RmrkPropertyInfo,
-		RmrkBaseInfo<AccountId>,
-		RmrkPartType,
-		RmrkTheme
-	> for Runtime {
-		fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
-			Ok(Default::default())
-		}
-
-		fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
-			Ok(Default::default())
-		}
-	}
-}
+impl_common_runtime_apis!();
 
 struct CheckInherents;