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
33 'frame-system/runtime-benchmarks',33 'frame-system/runtime-benchmarks',
34]34]
35
35unique-runtime = []36opal-runtime = []
36quartz-runtime = []37quartz-runtime = []
38unique-runtime = []
3739
38refungible = []40refungible = []
3941
modifiedruntime/common/src/lib.rsdiffbeforeafterboth
23pub mod sponsoring;23pub mod sponsoring;
24pub mod types;24pub mod types;
25pub mod weights;25pub mod weights;
26pub mod construct_runtime;
2627
modifiedruntime/common/src/runtime_apis.rsdiffbeforeafterboth
154 }154 }
155 }155 }
156
157 impl rmrk_rpc::RmrkApi<
158 Block,
159 AccountId,
160 RmrkCollectionInfo<AccountId>,
161 RmrkInstanceInfo<AccountId>,
162 RmrkResourceInfo,
163 RmrkPropertyInfo,
164 RmrkBaseInfo<AccountId>,
165 RmrkPartType,
166 RmrkTheme
167 > for Runtime {
168 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
169 #[cfg(feature = "rmrk")]
170 return pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>();
171
172 #[cfg(not(feature = "rmrk"))]
173 return Ok(Default::default());
174 }
175
176 fn collection_by_id(
177 #[allow(unused_variables)]
178 collection_id: RmrkCollectionId
179 ) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
180 #[cfg(feature = "rmrk")]
181 return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);
182
183 #[cfg(not(feature = "rmrk"))]
184 return Ok(Default::default())
185 }
186
187 fn nft_by_id(
188 #[allow(unused_variables)]
189 collection_id: RmrkCollectionId,
190
191 #[allow(unused_variables)]
192 nft_by_id: RmrkNftId
193 ) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
194 #[cfg(feature = "rmrk")]
195 return pallet_proxy_rmrk_core::rpc::nft_by_id::<Runtime>(collection_id, nft_by_id);
196
197 #[cfg(not(feature = "rmrk"))]
198 return Ok(Default::default())
199 }
200
201 fn account_tokens(
202 #[allow(unused_variables)]
203 account_id: AccountId,
204
205 #[allow(unused_variables)]
206 collection_id: RmrkCollectionId
207 ) -> Result<Vec<RmrkNftId>, DispatchError> {
208 #[cfg(feature = "rmrk")]
209 return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);
210
211 #[cfg(not(feature = "rmrk"))]
212 return Ok(Default::default())
213 }
214
215 fn nft_children(
216 #[allow(unused_variables)]
217 collection_id: RmrkCollectionId,
218
219 #[allow(unused_variables)]
220 nft_id: RmrkNftId
221 ) -> Result<Vec<RmrkNftChild>, DispatchError> {
222 #[cfg(feature = "rmrk")]
223 return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);
224
225 #[cfg(not(feature = "rmrk"))]
226 return Ok(Default::default())
227 }
228
229 fn collection_properties(
230 #[allow(unused_variables)]
231 collection_id: RmrkCollectionId,
232
233 #[allow(unused_variables)]
234 filter_keys: Option<Vec<RmrkPropertyKey>>
235 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
236 #[cfg(feature = "rmrk")]
237 return pallet_proxy_rmrk_core::rpc::collection_properties::<Runtime>(collection_id, filter_keys);
238
239 #[cfg(not(feature = "rmrk"))]
240 return Ok(Default::default())
241 }
242
243 fn nft_properties(
244 #[allow(unused_variables)]
245 collection_id: RmrkCollectionId,
246
247 #[allow(unused_variables)]
248 nft_id: RmrkNftId,
249
250 #[allow(unused_variables)]
251 filter_keys: Option<Vec<RmrkPropertyKey>>
252 ) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
253 #[cfg(feature = "rmrk")]
254 return pallet_proxy_rmrk_core::rpc::nft_properties::<Runtime>(collection_id, nft_id, filter_keys);
255
256 #[cfg(not(feature = "rmrk"))]
257 return Ok(Default::default())
258 }
259
260 fn nft_resources(
261 #[allow(unused_variables)]
262 collection_id: RmrkCollectionId,
263
264 #[allow(unused_variables)]
265 nft_id: RmrkNftId
266 ) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
267 #[cfg(feature = "rmrk")]
268 return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);
269
270 #[cfg(not(feature = "rmrk"))]
271 return Ok(Default::default())
272 }
273
274 fn nft_resource_priority(
275 #[allow(unused_variables)]
276 collection_id: RmrkCollectionId,
277
278 #[allow(unused_variables)]
279 nft_id: RmrkNftId,
280
281 #[allow(unused_variables)]
282 resource_id: RmrkResourceId
283 ) -> Result<Option<u32>, DispatchError> {
284 #[cfg(feature = "rmrk")]
285 return pallet_proxy_rmrk_core::rpc::nft_resource_priority::<Runtime>(collection_id, nft_id, resource_id);
286
287 #[cfg(not(feature = "rmrk"))]
288 return Ok(Default::default())
289 }
290
291 fn base(
292 #[allow(unused_variables)]
293 base_id: RmrkBaseId
294 ) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
295 #[cfg(feature = "rmrk")]
296 return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);
297
298 #[cfg(not(feature = "rmrk"))]
299 return Ok(Default::default())
300 }
301
302 fn base_parts(
303 #[allow(unused_variables)]
304 base_id: RmrkBaseId
305 ) -> Result<Vec<RmrkPartType>, DispatchError> {
306 #[cfg(feature = "rmrk")]
307 return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);
308
309 #[cfg(not(feature = "rmrk"))]
310 return Ok(Default::default())
311 }
312
313 fn theme_names(
314 #[allow(unused_variables)]
315 base_id: RmrkBaseId
316 ) -> Result<Vec<RmrkThemeName>, DispatchError> {
317 #[cfg(feature = "rmrk")]
318 return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);
319
320 #[cfg(not(feature = "rmrk"))]
321 Ok(Default::default())
322 }
323
324 fn theme(
325 #[allow(unused_variables)]
326 base_id: RmrkBaseId,
327
328 #[allow(unused_variables)]
329 theme_name: RmrkThemeName,
330
331 #[allow(unused_variables)]
332 filter_keys: Option<Vec<RmrkPropertyKey>>
333 ) -> Result<Option<RmrkTheme>, DispatchError> {
334 #[cfg(feature = "rmrk")]
335 return pallet_proxy_rmrk_equip::rpc::theme::<Runtime>(base_id, theme_name, filter_keys);
336
337 #[cfg(not(feature = "rmrk"))]
338 return Ok(Default::default())
339 }
340 }
156341
157 impl sp_api::Core<Block> for Runtime {342 impl sp_api::Core<Block> for Runtime {
158 fn version() -> RuntimeVersion {343 fn version() -> RuntimeVersion {
modifiedruntime/opal/Cargo.tomldiffbeforeafterboth
16targets = ['x86_64-unknown-linux-gnu']16targets = ['x86_64-unknown-linux-gnu']
1717
18[features]18[features]
19default = ['std', 'new-functionality']19default = ['std', 'opal-runtime']
20runtime-benchmarks = [20runtime-benchmarks = [
21 'hex-literal',21 'hex-literal',
22 'frame-benchmarking',22 'frame-benchmarking',
119 "orml-vesting/std",119 "orml-vesting/std",
120]120]
121limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']121limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
122new-functionality = [122opal-runtime = ['rmrk']
123 'unique-runtime-common/refungible',123
124]124rmrk = []
125125
126################################################################################126################################################################################
127# Substrate Dependencies127# Substrate Dependencies
399399
400[dependencies]400[dependencies]
401log = { version = "0.4.16", default-features = false }401log = { version = "0.4.16", default-features = false }
402unique-runtime-common = { path = "../common", default-features = false }402unique-runtime-common = { path = "../common", default-features = false, features = ['refungible'] }
403scale-info = { version = "2.0.1", default-features = false, features = [403scale-info = { version = "2.0.1", default-features = false, features = [
404 "derive",404 "derive",
405] }405] }
modifiedruntime/opal/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::{
130//use xcm_executor::traits::MatchesFungible;130//use xcm_executor::traits::MatchesFungible;
131131
132use 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}
912913
914#[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}
917919
920#[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}
11221125
1123construct_runtime!(1126construct_runtime!();
1124 pub enum Runtime where
1125 Block = Block,
1126 NodeBlock = opaque::Block,
1127 UncheckedExtrinsic = UncheckedExtrinsic
1128 {
1129 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
1130 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
1131
1132 Aura: pallet_aura::{Pallet, Config<T>} = 22,
1133 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
1134
1135 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,
1145
1146 // 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,
1151
1152 // Unique Pallets
1153 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 = 63
1157 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,
1166
1167 // Frontier
1168 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
1169 Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
1170
1171 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);
11771127
1178pub struct TransactionConverter;1128pub struct TransactionConverter;
1309 }};1259 }};
1310}1260}
13111261
1312impl_common_runtime_apis! {1262impl_common_runtime_apis!();
1313 #![custom_apis]
1314
1315 impl rmrk_rpc::RmrkApi<
1316 Block,
1317 AccountId,
1318 RmrkCollectionInfo<AccountId>,
1319 RmrkInstanceInfo<AccountId>,
1320 RmrkResourceInfo,
1321 RmrkPropertyInfo,
1322 RmrkBaseInfo<AccountId>,
1323 RmrkPartType,
1324 RmrkTheme
1325 > for Runtime {
1326 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
1327 pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
1328 }
1329
1330 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 }
1333
1334 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 }
1337
1338 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 }
1341
1342 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 }
1345
1346 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 }
1349
1350 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 }
1353
1354 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 }
1357
1358 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 }
1361
1362 fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
1363 pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
1364 }
1365
1366 fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
1367 pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
1368 }
1369
1370 fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
1371 pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
1372 }
1373
1374 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}
13791263
1380struct CheckInherents;1264struct CheckInherents;
13811265
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
16targets = ['x86_64-unknown-linux-gnu']16targets = ['x86_64-unknown-linux-gnu']
1717
18[features]18[features]
19default = ['std', 'new-functionality']19default = ['std', 'quartz-runtime']
20runtime-benchmarks = [20runtime-benchmarks = [
21 'hex-literal',21 'hex-literal',
22 'frame-benchmarking',22 'frame-benchmarking',
118 "orml-vesting/std",118 "orml-vesting/std",
119]119]
120limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']120limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
121new-functionality = []121quartz-runtime = []
122
123rmrk = []
122124
123################################################################################125################################################################################
124# Substrate Dependencies126# Substrate Dependencies
modifiedruntime/quartz/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::*,
909 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;910 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
910}911}
911912
912// 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 {918
918// 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}
921924
922impl pallet_unique::Config for Runtime {925impl pallet_unique::Config for Runtime {
923 type Event = Event;926 type Event = Event;
1119}1122}
11201123
1121construct_runtime!(1124construct_runtime!();
1122 pub enum Runtime where
1123 Block = Block,
1124 NodeBlock = opaque::Block,
1125 UncheckedExtrinsic = UncheckedExtrinsic
1126 {
1127 ParachainSystem: cumulus_pallet_parachain_system::{Pallet, Call, Config, Storage, Inherent, Event<T>, ValidateUnsigned} = 20,
1128 ParachainInfo: parachain_info::{Pallet, Storage, Config} = 21,
1129
1130 Aura: pallet_aura::{Pallet, Config<T>} = 22,
1131 AuraExt: cumulus_pallet_aura_ext::{Pallet, Config} = 23,
1132
1133 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,
1143
1144 // 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,
1149
1150 // Unique Pallets
1151 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 = 63
1155 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,
1164
1165 // Frontier
1166 EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
1167 Ethereum: pallet_ethereum::{Pallet, Config, Call, Storage, Event, Origin} = 101,
1168
1169 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);
11751125
1176pub struct TransactionConverter;1126pub struct TransactionConverter;
1309 }};1259 }};
1310}1260}
13111261
1312impl_common_runtime_apis! {1262impl_common_runtime_apis!();
1313 #![custom_apis]
1314
1315 impl rmrk_rpc::RmrkApi<
1316 Block,
1317 AccountId,
1318 RmrkCollectionInfo<AccountId>,
1319 RmrkInstanceInfo<AccountId>,
1320 RmrkResourceInfo,
1321 RmrkPropertyInfo,
1322 RmrkBaseInfo<AccountId>,
1323 RmrkPartType,
1324 RmrkTheme
1325 > for Runtime {
1326
1327 // fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {
1328 // pallet_proxy_rmrk_core::rpc::last_collection_idx::<Runtime>()
1329 // }
1330
1331 // 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 // }
1334
1335 // 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 // }
1338
1339 // 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 // }
1342
1343 // 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 // }
1346
1347 // 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 // }
1350
1351 // 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 // }
1354
1355 // 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 // }
1358
1359 // 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 // }
1362
1363 // fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
1364 // pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id)
1365 // }
1366
1367 // fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
1368 // pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id)
1369 // }
1370
1371 // fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
1372 // pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id)
1373 // }
1374
1375 // 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 }
1382
1383 fn collection_by_id(_collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {
1384 Ok(Default::default())
1385 }
1386
1387 fn nft_by_id(_collection_id: RmrkCollectionId, _nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {
1388 Ok(Default::default())
1389 }
1390
1391 fn account_tokens(_account_id: AccountId, _collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {
1392 Ok(Default::default())
1393 }
1394
1395 fn nft_children(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {
1396 Ok(Default::default())
1397 }
1398
1399 fn collection_properties(_collection_id: RmrkCollectionId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
1400 Ok(Default::default())
1401 }
1402
1403 fn nft_properties(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {
1404 Ok(Default::default())
1405 }
1406
1407 fn nft_resources(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {
1408 Ok(Default::default())
1409 }
1410
1411 fn nft_resource_priority(_collection_id: RmrkCollectionId, _nft_id: RmrkNftId, _resource_id: RmrkResourceId) -> Result<Option<u32>, DispatchError> {
1412 Ok(Default::default())
1413 }
1414
1415 fn base(_base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {
1416 Ok(Default::default())
1417 }
1418
1419 fn base_parts(_base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {
1420 Ok(Default::default())
1421 }
1422
1423 fn theme_names(_base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {
1424 Ok(Default::default())
1425 }
1426
1427 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}
14341263
1435struct CheckInherents;1264struct CheckInherents;
14361265
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
16targets = ['x86_64-unknown-linux-gnu']16targets = ['x86_64-unknown-linux-gnu']
1717
18[features]18[features]
19default = ['std', 'new-functionality']19default = ['std', 'unique-runtime']
20runtime-benchmarks = [20runtime-benchmarks = [
21 'hex-literal',21 'hex-literal',
22 'frame-benchmarking',22 'frame-benchmarking',
119 "orml-vesting/std",119 "orml-vesting/std",
120]120]
121limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']121limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
122new-functionality = []122unique-runtime = []
123123
124################################################################################124################################################################################
125# Substrate Dependencies125# 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