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
--- a/runtime/common/src/runtime_apis.rs
+++ b/runtime/common/src/runtime_apis.rs
@@ -154,6 +154,191 @@
                 }
             }
 
+            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> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>();
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default());
+                }
+
+                fn collection_by_id(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId
+                ) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn nft_by_id(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    nft_by_id: RmrkNftId
+                ) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn account_tokens(
+                    #[allow(unused_variables)]
+                    account_id: AccountId,
+
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId
+                ) -> Result<Vec<RmrkNftId>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn nft_children(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    nft_id: RmrkNftId
+                ) -> Result<Vec<RmrkNftChild>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn collection_properties(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    filter_keys: Option<Vec<RmrkPropertyKey>>
+                ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn nft_properties(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    nft_id: RmrkNftId,
+
+                    #[allow(unused_variables)]
+                    filter_keys: Option<Vec<RmrkPropertyKey>>
+                ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn nft_resources(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    nft_id: RmrkNftId
+                ) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn nft_resource_priority(
+                    #[allow(unused_variables)]
+                    collection_id: RmrkCollectionId,
+
+                    #[allow(unused_variables)]
+                    nft_id: RmrkNftId,
+
+                    #[allow(unused_variables)]
+                    resource_id: RmrkResourceId
+                ) -> Result<Option<u32>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn base(
+                    #[allow(unused_variables)]
+                    base_id: RmrkBaseId
+                ) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn base_parts(
+                    #[allow(unused_variables)]
+                    base_id: RmrkBaseId
+                ) -> Result<Vec<RmrkPartType>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+
+                fn theme_names(
+                    #[allow(unused_variables)]
+                    base_id: RmrkBaseId
+                ) -> Result<Vec<RmrkThemeName>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    Ok(Default::default())
+                }
+
+                fn theme(
+                    #[allow(unused_variables)]
+                    base_id: RmrkBaseId,
+
+                    #[allow(unused_variables)]
+                    theme_name: RmrkThemeName,
+
+                    #[allow(unused_variables)]
+                    filter_keys: Option<Vec<RmrkPropertyKey>>
+                ) -> Result<Option<RmrkTheme>, DispatchError> {
+                    #[cfg(feature = "rmrk")]
+                    return pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys);
+
+                    #[cfg(not(feature = "rmrk"))]
+                    return Ok(Default::default())
+                }
+            }
+
             impl sp_api::Core<Block> for Runtime {
                 fn version() -> RuntimeVersion {
                     VERSION
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
54 OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,54 OnMethodCall, Account as EVMAccount, FeeCalculator, GasWeightMapping,
55};55};
56pub use frame_support::{56pub use frame_support::{
57 construct_runtime, match_types,57 match_types,
58 dispatch::DispatchResult,58 dispatch::DispatchResult,
59 PalletId, parameter_types, StorageValue, ConsensusEngineId,59 PalletId, parameter_types, StorageValue, ConsensusEngineId,
60 traits::{60 traits::{
128use xcm_executor::traits::{MatchesFungible, WeightTrader};128use xcm_executor::traits::{MatchesFungible, WeightTrader};
129129
130use unique_runtime_common::{130use unique_runtime_common::{
131 construct_runtime,
131 impl_common_runtime_apis,132 impl_common_runtime_apis,
132 types::*,133 types::*,
133 constants::*,134 constants::*,
910 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;911 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
911}912}
913
914#[cfg(feature = "rmrk")]
915impl pallet_proxy_rmrk_core::Config for Runtime {
916 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;
917 type Event = Event;
918}
919
920#[cfg(feature = "rmrk")]
921impl pallet_proxy_rmrk_equip::Config for Runtime {
922 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;
923 type Event = Event;
924}
912925
913impl pallet_unique::Config for Runtime {926impl pallet_unique::Config for Runtime {
914 type Event = Event;927 type Event = Event;
1110}1123}
11111124
1112construct_runtime!(1125construct_runtime!();
1113 pub enum Runtime where
1114 Block = Block,
1115 NodeBlock = opaque::Block,
1116 UncheckedExtrinsic = UncheckedExtrinsic
1117 {
1118 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
1119 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
1120
1121 Aura: pallet_aura::{Pallet, Config<T>} = 22,
1122 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
1123
1124 Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,
1125 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,
1126 Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,
1127 TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,
1128 Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,
1129 Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,
1130 System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,
1131 Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,
1132 // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,
1133 // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,
1134
1135 // XCM helpers.
1136 XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,
1137 PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,
1138 CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,
1139 DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
1140
1141 // Unique Pallets
1142 Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
1143 Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
1144 // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
1145 // free = 63
1146 Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,
1147 // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,
1148 Common: pallet_common::{Pallet, Storage, Event<T>} = 66,
1149 Fungible: pallet_fungible::{Pallet, Storage} = 67,
1150 // Refungible: pallet_refungible::{Pallet, Storage} = 68,
1151 Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
1152 Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
1153
1154 // Frontier
1155 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
1156 Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
1157
1158 EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,
1159 EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,
1160 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,
1161 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,
1162 }
1163);
11641126
1165pub struct TransactionConverter;1127pub struct TransactionConverter;
1297 }};1259 }};
1298}1260}
12991261
1300impl_common_runtime_apis! {1262impl_common_runtime_apis!();
1301 #![custom_apis]
1302
1303 impl rmrk_rpc::RmrkApi<
1304 Block,
1305 AccountId,
1306 RmrkCollectionInfo<AccountId>,
1307 RmrkInstanceInfo<AccountId>,
1308 RmrkResourceInfo,
1309 RmrkPropertyInfo,
1310 RmrkBaseInfo<AccountId>,
1311 RmrkPartType,
1312 RmrkTheme
1313 > for Runtime {
1314 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
1315 Ok(Default::default())
1316 }
1317
1318 fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
1319 Ok(Default::default())
1320 }
1321
1322 fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
1323 Ok(Default::default())
1324 }
1325
1326 fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
1327 Ok(Default::default())
1328 }
1329
1330 fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
1331 Ok(Default::default())
1332 }
1333
1334 fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
1335 Ok(Default::default())
1336 }
1337
1338 fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
1339 Ok(Default::default())
1340 }
1341
1342 fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
1343 Ok(Default::default())
1344 }
1345
1346 fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
1347 Ok(Default::default())
1348 }
1349
1350 fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
1351 Ok(Default::default())
1352 }
1353
1354 fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
1355 Ok(Default::default())
1356 }
1357
1358 fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
1359 Ok(Default::default())
1360 }
1361
1362 fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {
1363 Ok(Default::default())
1364 }
1365 }
1366}
13671263
1368struct CheckInherents;1264struct CheckInherents;
13691265