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.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;
runtime/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.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::{128use xcm_executor::traits::{MatchesFungible, WeightTrader};128use xcm_executor::traits::{MatchesFungible, WeightTrader};129129130use 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::*,909 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;910 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;910}911}911912912// impl pallet_proxy_rmrk_core::Config for Runtime {913#[cfg(feature = "rmrk")]913// type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;914impl pallet_proxy_rmrk_core::Config for Runtime {914// type Event = Event;915 type WeightInfo = pallet_proxy_rmrk_core::weights::SubstrateWeight<Self>;915// }916 type Event = Event;916917}917// impl pallet_proxy_rmrk_equip::Config for Runtime {918918// type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;919#[cfg(feature = "rmrk")]919// type Event = Event;920impl pallet_proxy_rmrk_equip::Config for Runtime {920// }921 type WeightInfo = pallet_proxy_rmrk_equip::weights::SubstrateWeight<Self>;922 type Event = Event;923}921924922impl pallet_unique::Config for Runtime {925impl pallet_unique::Config for Runtime {923 type Event = Event;926 type Event = Event;1119}1122}112011231121construct_runtime!(1124construct_runtime!();1122 pub enum Runtime where1123 Block = Block,1124 NodeBlock = opaque::Block,1125 UncheckedExtrinsic = UncheckedExtrinsic1126 {1127 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,1128 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,11291130 Aura: pallet_aura::{Pallet, Config<T>} = 22,1131 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,11321133 Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>} = 30,1134 RandomnessCollectiveFlip: pallet_randomness_collective_flip::{Pallet, Storage} = 31,1135 Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent} = 32,1136 TransactionPayment: pallet_transaction_payment::{Pallet, Storage} = 33,1137 Treasury: pallet_treasury::{Pallet, Call, Storage, Config, Event<T>} = 34,1138 Sudo: pallet_sudo::{Pallet, Call, Storage, Config<T>, Event<T>} = 35,1139 System: frame_system::{Pallet, Call, Storage, Config, Event<T>} = 36,1140 Vesting: orml_vesting::{Pallet, Storage, Call, Event<T>, Config<T>} = 37,1141 // Vesting: pallet_vesting::{Pallet, Call, Config<T>, Storage, Event<T>} = 37,1142 // Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>} = 38,11431144 // XCM helpers.1145 XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 50,1146 PolkadotXcm: pallet_xcm::{Pallet, Call, Event<T>, Origin} = 51,1147 CumulusXcm: cumulus_pallet_xcm::{Pallet, Call, Event<T>, Origin} = 52,1148 DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,11491150 // Unique Pallets1151 Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,1152 Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,1153 // Scheduler: pallet_unique_scheduler::{Pallet, Call, Storage, Event<T>} = 62,1154 // free = 631155 Charging: pallet_charge_transaction::{Pallet, Call, Storage } = 64,1156 // ContractHelpers: pallet_contract_helpers::{Pallet, Call, Storage} = 65,1157 Common: pallet_common::{Pallet, Storage, Event<T>} = 66,1158 Fungible: pallet_fungible::{Pallet, Storage} = 67,1159 // Refungible: pallet_refungible::{Pallet, Storage} = 68,1160 Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,1161 Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,1162 // RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,1163 // RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,11641165 // Frontier1166 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,1167 Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,11681169 EvmCoderSubstrate: pallet_evm_coder_substrate::{Pallet, Storage} = 150,1170 EvmContractHelpers: pallet_evm_contract_helpers::{Pallet, Storage} = 151,1171 EvmTransactionPayment: pallet_evm_transaction_payment::{Pallet} = 152,1172 EvmMigration: pallet_evm_migration::{Pallet, Call, Storage} = 153,1173 }1174);117511251176pub struct TransactionConverter;1126pub 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 1327 // fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {1328 // pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()1329 // }13301331 // fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {1332 // pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id)1333 // }13341335 // fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {1336 // pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id)1337 // }13381339 // fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {1340 // pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id)1341 // }13421343 // fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {1344 // pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id)1345 // }13461347 // fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1348 // pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys)1349 // }13501351 // fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1352 // pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys)1353 // }13541355 // fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {1356 // pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id)1357 // }13581359 // fn nft_resource_priority(collection_id: RmrkCollectionId, nft_id: RmrkNftId, resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {1360 // pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id)1361 // }13621363 // fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {1364 // pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)1365 // }13661367 // fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {1368 // pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)1369 // }13701371 // fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {1372 // pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)1373 // }13741375 // fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {1376 // pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys)1377 // }1378 1379 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {1380 Ok(Default::default())1381 }13821383 fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {1384 Ok(Default::default())1385 }13861387 fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {1388 Ok(Default::default())1389 }13901391 fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {1392 Ok(Default::default())1393 }13941395 fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {1396 Ok(Default::default())1397 }13981399 fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1400 Ok(Default::default())1401 }14021403 fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {1404 Ok(Default::default())1405 }14061407 fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {1408 Ok(Default::default())1409 }14101411 fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {1412 Ok(Default::default())1413 }14141415 fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {1416 Ok(Default::default())1417 }14181419 fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {1420 Ok(Default::default())1421 }14221423 fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {1424 Ok(Default::default())1425 }14261427 fn theme(_base_id: RmrkBaseId, _theme_name: RmrkThemeName, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {1428 Ok(Default::default())1429 }1430 1431 1432 }1433}143412631435struct CheckInherents;1264struct CheckInherents;14361265runtime/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;