difftreelog
feat common construct_runtime, rmrk feature
in: master
9 files changed
runtime/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 = []
runtime/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;
runtime/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
runtime/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",
] }
runtime/opal/src/lib.rsdiffbeforeafterboth54 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::{130//use xcm_executor::traits::MatchesFungible;130//use xcm_executor::traits::MatchesFungible;131131132use unique_runtime_common::{132use unique_runtime_common::{133 construct_runtime,133 impl_common_runtime_apis,134 impl_common_runtime_apis,134 types::*,135 types::*,135 constants::*,136 constants::*,910 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;911 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;911}912}912913914#[cfg(feature = "rmrk")]913impl pallet_proxy_rmrk_core::Config for Runtime {915impl pallet_proxy_rmrk_core::Config for Runtime {914 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;916 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;915 type Event = Event;917 type Event = Event;916}918}917919920#[cfg(feature = "rmrk")]918impl pallet_proxy_rmrk_equip::Config for Runtime {921impl pallet_proxy_rmrk_equip::Config for Runtime {919 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;922 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;920 type Event = Event;923 type Event = Event;1121}1124}112211251123construct_runtime!(1126construct_runtime!();1124 pub enum Runtime where1125 Block = Block,1126 NodeBlock = opaque::Block,1127 UncheckedExtrinsic = UncheckedExtrinsic1128 {1129 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,1130 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,11311132 Aura: pallet_aura::{Pallet, Config<T>} = 22,1133 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,11341135 Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,1136 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,1137 Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,1138 TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,1139 Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,1140 Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,1141 System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,1142 Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,1143 // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,1144 // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,11451146 // XCM helpers.1147 XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,1148 PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,1149 CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,1150 DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,11511152 // Unique Pallets1153 Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,1154 Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,1155 Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,1156 // free = 631157 Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,1158 // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,1159 Common: pallet_common::{Pallet, Storage, Event<T>} = 66,1160 Fungible: pallet_fungible::{Pallet, Storage} = 67,1161 Refungible: pallet_refungible::{Pallet, Storage} = 68,1162 Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,1163 Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,1164 RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,1165 RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,11661167 // Frontier1168 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,1169 Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,11701171 EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,1172 EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,1173 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,1174 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,1175 }1176);117711271178pub struct TransactionConverter;1128pub struct TransactionConverter;1309 }};1259 }};1310}1260}131112611312impl_common_runtime_apis! {1262impl_common_runtime_apis!();1313 #![custom_apis]13141315 impl rmrk_rpc::RmrkApi<1316 Block,1317 AccountId,1318 RmrkCollectionInfo<AccountId>,1319 RmrkInstanceInfo<AccountId>,1320 RmrkResourceInfo,1321 RmrkPropertyInfo,1322 RmrkBaseInfo<AccountId>,1323 RmrkPartType,1324 RmrkTheme1325 > for Runtime {1326 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {1327 pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()1328 }13291330 fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {1331 pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)1332 }13331334 fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {1335 pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)1336 }13371338 fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {1339 pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)1340 }13411342 fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {1343 pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)1344 }13451346 fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1347 pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)1348 }13491350 fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1351 pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)1352 }13531354 fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {1355 pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)1356 }13571358 fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {1359 pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)1360 }13611362 fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {1363 pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)1364 }13651366 fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {1367 pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)1368 }13691370 fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {1371 pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)1372 }13731374 fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {1375 pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)1376 }1377 }1378}137912631380struct CheckInherents;1264struct CheckInherents;13811265runtime/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
runtime/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;
runtime/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
runtime/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;