difftreelog
build remove RMRK usage
in: master
6 files changed
node/cli/src/service.rsdiffbeforeafterboth--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -68,10 +68,10 @@
use unique_runtime_common::types::{AuraId, RuntimeInstance, AccountId, Balance, Index, Hash, Block};
// RMRK
-use up_data_structs::{
+/* TODO free RMRK! use up_data_structs::{
RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo,
RmrkPartType, RmrkTheme,
-};
+};*/
/// Unique native executor instance.
#[cfg(feature = "unique-runtime")]
@@ -353,6 +353,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ /* TODO free RMRK!
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -363,7 +364,7 @@
RmrkBaseInfo<AccountId>,
RmrkPartType,
RmrkTheme,
- > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ >*/ + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ sp_api::Metadata<Block>
+ sp_offchain::OffchainWorkerApi<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>,
@@ -644,6 +645,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ /* TODO free RMRK!
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -654,7 +656,7 @@
RmrkBaseInfo<AccountId>,
RmrkPartType,
RmrkTheme,
- > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ >*/ + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ sp_api::Metadata<Block>
+ sp_offchain::OffchainWorkerApi<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>
@@ -787,6 +789,7 @@
+ pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance>
+ sp_api::ApiExt<Block, StateBackend = sc_client_api::StateBackendFor<FullBackend, Block>>
+ up_rpc::UniqueApi<Block, Runtime::CrossAccountId, AccountId>
+ /* TODO free RMRK!
+ rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -797,7 +800,7 @@
RmrkBaseInfo<AccountId>,
RmrkPartType,
RmrkTheme,
- > + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ >*/ + substrate_frame_rpc_system::AccountNonceApi<Block, AccountId, Index>
+ sp_api::Metadata<Block>
+ sp_offchain::OffchainWorkerApi<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>
node/rpc/src/lib.rsdiffbeforeafterboth--- a/node/rpc/src/lib.rs
+++ b/node/rpc/src/lib.rs
@@ -44,10 +44,10 @@
Hash, AccountId, RuntimeInstance, Index, Block, BlockNumber, Balance,
};
// RMRK
-use up_data_structs::{
+/* TODO free RMRK! use up_data_structs::{
RmrkCollectionInfo, RmrkInstanceInfo, RmrkResourceInfo, RmrkPropertyInfo, RmrkBaseInfo,
RmrkPartType, RmrkTheme,
-};
+};*/
/// Public io handler for exporting into other modules
pub type IoHandler = jsonrpc_core::IoHandler<sc_rpc::Metadata>;
@@ -149,6 +149,7 @@
C::Api: fp_rpc::EthereumRuntimeRPCApi<Block>,
C::Api: fp_rpc::ConvertTransactionRuntimeApi<Block>,
C::Api: up_rpc::UniqueApi<Block, <R as RuntimeInstance>::CrossAccountId, AccountId>,
+ /* TODO free RMRK!
C::Api: rmrk_rpc::RmrkApi<
Block,
AccountId,
@@ -159,7 +160,7 @@
RmrkBaseInfo<AccountId>,
RmrkPartType,
RmrkTheme,
- >,
+ >,*/
B: sc_client_api::Backend<Block> + Send + Sync + 'static,
B::State: sc_client_api::backend::StateBackend<sp_runtime::traits::HashFor<Block>>,
P: TransactionPool<Block = Block> + 'static,
@@ -233,7 +234,7 @@
// todo look into
//let unique = Unique::new(client.clone());
io.extend_with(UniqueApi::to_delegate(Unique::new(client.clone())));
- io.extend_with(RmrkApi::to_delegate(Unique::new(client.clone())));
+ // TODO free RMRK! io.extend_with(RmrkApi::to_delegate(Unique::new(client.clone())));
if let Some(filter_pool) = filter_pool {
io.extend_with(EthFilterApiServer::to_delegate(EthFilterApi::new(
runtime/common/src/runtime_apis.rsdiffbeforeafterboth1#[macro_export]2macro_rules! impl_common_runtime_apis {3 (4 $(5 #![custom_apis]67 $($custom_apis:tt)+8 )?9 ) => {10 impl_runtime_apis! {11 $($($custom_apis)+)?1213 impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {14 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {15 dispatch_unique_runtime!(collection.account_tokens(account))16 }17 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {18 dispatch_unique_runtime!(collection.collection_tokens())19 }20 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {21 dispatch_unique_runtime!(collection.token_exists(token))22 }2324 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {25 dispatch_unique_runtime!(collection.token_owner(token))26 }27 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {28 let budget = up_data_structs::budget::Value::new(10);2930 Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))31 }3233 fn collection_properties(34 collection: CollectionId,35 keys: Option<Vec<Vec<u8>>>36 ) -> Result<Vec<Property>, DispatchError> {37 let keys = keys.map(38 |keys| Common::bytes_keys_to_property_keys(keys)39 ).transpose()?;4041 Common::filter_collection_properties(collection, keys)42 }4344 fn token_properties(45 collection: CollectionId,46 token_id: TokenId,47 keys: Option<Vec<Vec<u8>>>48 ) -> Result<Vec<Property>, DispatchError> {49 let keys = keys.map(50 |keys| Common::bytes_keys_to_property_keys(keys)51 ).transpose()?;5253 dispatch_unique_runtime!(collection.token_properties(token_id, keys))54 }5556 fn property_permissions(57 collection: CollectionId,58 keys: Option<Vec<Vec<u8>>>59 ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {60 let keys = keys.map(61 |keys| Common::bytes_keys_to_property_keys(keys)62 ).transpose()?;6364 Common::filter_property_permissions(collection, keys)65 }6667 fn token_data(68 collection: CollectionId,69 token_id: TokenId,70 keys: Option<Vec<Vec<u8>>>71 ) -> Result<TokenData<CrossAccountId>, DispatchError> {72 let token_data = TokenData {73 properties: Self::token_properties(collection, token_id, keys)?,74 owner: Self::token_owner(collection, token_id)?75 };7677 Ok(token_data)78 }7980 fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {81 dispatch_unique_runtime!(collection.total_supply())82 }83 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {84 dispatch_unique_runtime!(collection.account_balance(account))85 }86 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {87 dispatch_unique_runtime!(collection.balance(account, token))88 }89 fn allowance(90 collection: CollectionId,91 sender: CrossAccountId,92 spender: CrossAccountId,93 token: TokenId,94 ) -> Result<u128, DispatchError> {95 dispatch_unique_runtime!(collection.allowance(sender, spender, token))96 }9798 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {99 Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))100 }101 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {102 Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))103 }104 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {105 Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))106 }107 fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {108 dispatch_unique_runtime!(collection.last_token_id())109 }110 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {111 Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))112 }113 fn collection_stats() -> Result<CollectionStats, DispatchError> {114 Ok(<pallet_common::Pallet<Runtime>>::collection_stats())115 }116 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {117 Ok(<$crate::sponsoring::UniqueSponsorshipPredict<Runtime> as118 $crate::sponsoring::SponsorshipPredict<Runtime>>::predict(119 collection,120 account,121 token))122 }123124 fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {125 Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))126 }127 }128129 impl rmrk_rpc::RmrkApi<130 Block,131 AccountId,132 RmrkCollectionInfo<AccountId>,133 RmrkInstanceInfo<AccountId>,134 RmrkResourceInfo,135 RmrkPropertyInfo,136 RmrkBaseInfo<AccountId>,137 RmrkPartType,138 RmrkTheme139 > for Runtime {140 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {141 Ok(RmrkCore::last_collection_idx())142 }143144 fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {145 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, RmrkDecode, RmrkRebind}};146147 let collection_id = CollectionId(collection_id);148 let collection = match RmrkCore::get_typed_nft_collection(collection_id, CollectionType::Regular) {149 Ok(c) => c,150 Err(_) => return Ok(None),151 };152153 let nfts_count = dispatch_unique_runtime!(collection_id.total_supply())?;154155 Ok(Some(RmrkCollectionInfo {156 issuer: collection.owner.clone(),157 metadata: RmrkCore::get_collection_property(collection_id, RmrkProperty::Metadata)?.decode_or_default(),158 max: collection.limits.token_limit,159 symbol: collection.token_prefix.rebind(),160 nfts_count161 }))162 }163164 fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {165 use up_data_structs::mapping::TokenAddressMapping;166 use pallet_proxy_rmrk_core::{RmrkProperty, misc::RmrkDecode};167168 let collection_id = CollectionId(collection_id);169 let nft_id = TokenId(nft_by_id);170 if !RmrkCore::nft_exists(collection_id, nft_id) { return Ok(None); }171172 let owner = match dispatch_unique_runtime!(collection_id.token_owner(nft_id))? {173 Some(owner) => match <Runtime as pallet_common::Config>::CrossTokenAddressMapping::address_to_token(&owner) {174 Some((col, tok)) => RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(col.0, tok.0),175 None => RmrkAccountIdOrCollectionNftTuple::AccountId(owner.as_sub().clone())176 },177 None => return Ok(None)178 };179180 let allowance = pallet_nonfungible::Allowance::<Runtime>::get((collection_id, nft_id));181182 Ok(Some(RmrkInstanceInfo {183 owner: owner,184 royalty: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::RoyaltyInfo)?.decode_or_default(),185 metadata: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::Metadata)?.decode_or_default(),186 equipped: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::Equipped)?.decode_or_default(),187 pending: allowance.is_some(),188 }))189 }190191 fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {192 use pallet_proxy_rmrk_core::misc::CollectionType;193194 let cross_account_id = CrossAccountId::from_sub(account_id);195 let collection_id = CollectionId(collection_id);196 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() { return Ok(Vec::new()); }197198 Ok(199 dispatch_unique_runtime!(collection_id.account_tokens(cross_account_id))?200 .into_iter()201 .map(|token| token.0)202 .collect()203 )204 }205206 fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {207 let collection_id = CollectionId(collection_id);208 let nft_id = TokenId(nft_id);209 if !RmrkCore::nft_exists(collection_id, nft_id) { return Ok(Vec::new()); }210211 Ok(212 pallet_nonfungible::TokenChildren::<Runtime>::iter_prefix((collection_id, nft_id))213 .filter_map(|(child_id, is_child)|214 match is_child {215 true => Some(RmrkNftChild {216 collection_id: child_id.0.0,217 nft_id: child_id.1.0,218 }),219 false => None,220 }221 ).collect()222 )223 }224225 fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {226 use pallet_proxy_rmrk_core::misc::CollectionType;227228 let collection_id = CollectionId(collection_id);229 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() {230 return Ok(Vec::new());231 }232233 let properties = RmrkCore::filter_user_properties(234 collection_id,235 /* token_id = */ None,236 filter_keys,237 |key, value| RmrkPropertyInfo {238 key,239 value240 }241 )?;242243 Ok(properties)244 }245246 fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {247 use pallet_proxy_rmrk_core::misc::NftType;248249 let collection_id = CollectionId(collection_id);250 let token_id = TokenId(nft_id);251252 if RmrkCore::ensure_nft_type(collection_id, token_id, NftType::Regular).is_err() {253 return Ok(Vec::new());254 }255256 let properties = RmrkCore::filter_user_properties(257 collection_id,258 Some(token_id),259 filter_keys,260 |key, value| RmrkPropertyInfo {261 key,262 value263 }264 )?;265266 Ok(properties)267 }268269 fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {270 use frame_support::BoundedVec;271 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};272273 let collection_id = CollectionId(collection_id);274 if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo make sure the collection type doesn't matter275276 let nft_id = TokenId(nft_id);277 if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }278279 let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)280 .unwrap()281 .decode_or_default();282 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Resource).is_err() { return Ok(Vec::new()); }283284 let resources = pallet_nonfungible::TokenProperties::<Runtime>::iter_prefix((resource_collection_id,))285 .filter_map(|(resource_id, properties)| Some(RmrkResourceInfo {286 id: BoundedVec::default(), // todo ResourceId property287 pending: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceAccept).unwrap().decode_or_default(),288 pending_removal: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceRemoval).unwrap().decode_or_default(),289 resource: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::ResourceType).unwrap().decode_or_default(),/* {290 RmrkResourceTypes::Basic(resource) => RmrkResourceTypes::Basic(),/*(RmrkBasicResource {291 src: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Src).unwrap().decode_or_default(),292 metadata: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Metadata).unwrap().decode_or_default(),293 license: RmrkCore::get_nft_property_inner(properties, RmrkProperty::License).unwrap().decode_or_default(),294 thumb: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Thumb).unwrap().decode_or_default(),295 },*///BasicResource<BoundedString>)296 _ => todo!(), //RmrkResourceTypes::Composable(ComposableResource<BoundedString, BoundedParts>),297 //RmrkResourceTypes::Slot(SlotResource<BoundedString>),298 },*/299 }))300 .collect();301302 Ok(resources)303 }304305 fn nft_resource_priorities(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceId>, DispatchError> {306 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};307308 let collection_id = CollectionId(collection_id);309 if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo ensure the collection type doesn't matter310311 let nft_id = TokenId(nft_id);312 if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }313314 /*let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)315 .unwrap()316 .decode_or_default();317 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Resource).is_err() { return Ok(Vec::new()); }318319 let resources = pallet_nonfungible::TokenProperties::<Runtime>::iter_prefix((resource_collection_id,))320 .filter_map(|(resource_id, properties)| Some((321 resource_id, // ResourceId property322 RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::Priority).unwrap().decode_or_default(),323 )))324 .collect()325 .sort_by_key(|(_, index)| *index)326 .into_iter().map(|(resource_id, _)| resource_id)*/327 let priorities = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourcePriorities)?.decode_or_default();328329 Ok(priorities)330 }331332 fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {333 use pallet_proxy_rmrk_core::{334 RmrkProperty, misc::{CollectionType, RmrkDecode, RmrkRebind},335 };336337 let collection_id = CollectionId(base_id);338 let collection = match RmrkCore::get_typed_nft_collection(collection_id, CollectionType::Base) {339 Ok(c) => c,340 Err(_) => return Ok(None),341 };342343 Ok(Some(RmrkBaseInfo {344 issuer: collection.owner.clone(),345 base_type: RmrkCore::get_collection_property(collection_id, RmrkProperty::BaseType)?.decode_or_default(),346 symbol: collection.token_prefix.rebind(),347 }))348 }349350 fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {351 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};352353 let collection_id = CollectionId(base_id);354 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() { return Ok(Vec::new()); }355356 let parts = dispatch_unique_runtime!(collection_id.collection_tokens())?357 .into_iter()358 .filter_map(|token_id| {359 let nft_type = RmrkCore::get_nft_type(collection_id, token_id).ok()?;360361 match nft_type {362 NftType::FixedPart => Some(RmrkPartType::FixedPart(RmrkFixedPart {363 id: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ExternalPartId).ok()?.decode_or_default(),364 src: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::Src).ok()?.decode_or_default(),365 z: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ZIndex).ok()?.decode_or_default(),366 })),367 NftType::SlotPart => Some(RmrkPartType::SlotPart(RmrkSlotPart {368 id: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ExternalPartId).ok()?.decode_or_default(),369 src: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::Src).ok()?.decode_or_default(),370 z: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ZIndex).ok()?.decode_or_default(),371 equippable: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::EquippableList).ok()?.decode_or_default(),372 })),373 _ => None374 }375 })376 .collect();377378 Ok(parts)379 }380381 fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {382 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, RmrkDecode}};383384 let collection_id = CollectionId(base_id);385 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() {386 return Ok(Vec::new());387 }388389 let theme_names = dispatch_unique_runtime!(collection_id.collection_tokens())?390 .iter()391 .filter_map(|token_id| {392 let nft_type = RmrkCore::get_nft_type(collection_id, *token_id).unwrap();393394 match nft_type {395 Theme => Some(396 RmrkCore::get_nft_property(collection_id, *token_id, RmrkProperty::ThemeName).unwrap().decode_or_default()397 ),398 _ => None399 }400 })401 .collect();402403 Ok(theme_names)404 }405406 fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {407 use pallet_proxy_rmrk_core::{408 RmrkProperty,409 misc::{CollectionType, NftType, RmrkDecode}410 };411412 let collection_id = CollectionId(base_id);413 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() {414 return Ok(None);415 }416417 let theme_info = dispatch_unique_runtime!(collection_id.collection_tokens())?418 .into_iter()419 .find_map(|token_id| {420 RmrkCore::ensure_nft_type(collection_id, token_id, NftType::Theme).ok()?;421422 let name: RmrkString = RmrkCore::get_nft_property(423 collection_id, token_id, RmrkProperty::ThemeName424 ).ok()?.decode_or_default();425426 if name == theme_name {427 Some((name, token_id))428 } else {429 None430 }431 });432433 let (name, theme_id) = match theme_info {434 Some((name, theme_id)) => (name, theme_id),435 None => return Ok(None)436 };437438 let properties = RmrkCore::filter_user_properties(439 collection_id,440 Some(theme_id),441 filter_keys,442 |key, value| RmrkThemeProperty {443 key,444 value445 }446 )?;447448 let inherit = RmrkCore::get_nft_property(449 collection_id,450 theme_id,451 RmrkProperty::ThemeInherit452 )?.decode_or_default();453454 let theme = RmrkTheme {455 name,456 properties,457 inherit,458 };459460 Ok(Some(theme))461 }462 }463464 impl sp_api::Core<Block> for Runtime {465 fn version() -> RuntimeVersion {466 VERSION467 }468469 fn execute_block(block: Block) {470 Executive::execute_block(block)471 }472473 fn initialize_block(header: &<Block as BlockT>::Header) {474 Executive::initialize_block(header)475 }476 }477478 impl sp_api::Metadata<Block> for Runtime {479 fn metadata() -> OpaqueMetadata {480 OpaqueMetadata::new(Runtime::metadata().into())481 }482 }483484 impl sp_block_builder::BlockBuilder<Block> for Runtime {485 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {486 Executive::apply_extrinsic(extrinsic)487 }488489 fn finalize_block() -> <Block as BlockT>::Header {490 Executive::finalize_block()491 }492493 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {494 data.create_extrinsics()495 }496497 fn check_inherents(498 block: Block,499 data: sp_inherents::InherentData,500 ) -> sp_inherents::CheckInherentsResult {501 data.check_extrinsics(&block)502 }503504 // fn random_seed() -> <Block as BlockT>::Hash {505 // RandomnessCollectiveFlip::random_seed().0506 // }507 }508509 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {510 fn validate_transaction(511 source: TransactionSource,512 tx: <Block as BlockT>::Extrinsic,513 hash: <Block as BlockT>::Hash,514 ) -> TransactionValidity {515 Executive::validate_transaction(source, tx, hash)516 }517 }518519 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {520 fn offchain_worker(header: &<Block as BlockT>::Header) {521 Executive::offchain_worker(header)522 }523 }524525 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {526 fn chain_id() -> u64 {527 <Runtime as pallet_evm::Config>::ChainId::get()528 }529530 fn account_basic(address: H160) -> EVMAccount {531 EVM::account_basic(&address)532 }533534 fn gas_price() -> U256 {535 <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()536 }537538 fn account_code_at(address: H160) -> Vec<u8> {539 EVM::account_codes(address)540 }541542 fn author() -> H160 {543 <pallet_evm::Pallet<Runtime>>::find_author()544 }545546 fn storage_at(address: H160, index: U256) -> H256 {547 let mut tmp = [0u8; 32];548 index.to_big_endian(&mut tmp);549 EVM::account_storages(address, H256::from_slice(&tmp[..]))550 }551552 #[allow(clippy::redundant_closure)]553 fn call(554 from: H160,555 to: H160,556 data: Vec<u8>,557 value: U256,558 gas_limit: U256,559 max_fee_per_gas: Option<U256>,560 max_priority_fee_per_gas: Option<U256>,561 nonce: Option<U256>,562 estimate: bool,563 access_list: Option<Vec<(H160, Vec<H256>)>>,564 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {565 let config = if estimate {566 let mut config = <Runtime as pallet_evm::Config>::config().clone();567 config.estimate = true;568 Some(config)569 } else {570 None571 };572573 let is_transactional = false;574 <Runtime as pallet_evm::Config>::Runner::call(575 CrossAccountId::from_eth(from),576 to,577 data,578 value,579 gas_limit.low_u64(),580 max_fee_per_gas,581 max_priority_fee_per_gas,582 nonce,583 access_list.unwrap_or_default(),584 is_transactional,585 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),586 ).map_err(|err| err.into())587 }588589 #[allow(clippy::redundant_closure)]590 fn create(591 from: H160,592 data: Vec<u8>,593 value: U256,594 gas_limit: U256,595 max_fee_per_gas: Option<U256>,596 max_priority_fee_per_gas: Option<U256>,597 nonce: Option<U256>,598 estimate: bool,599 access_list: Option<Vec<(H160, Vec<H256>)>>,600 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {601 let config = if estimate {602 let mut config = <Runtime as pallet_evm::Config>::config().clone();603 config.estimate = true;604 Some(config)605 } else {606 None607 };608609 let is_transactional = false;610 <Runtime as pallet_evm::Config>::Runner::create(611 CrossAccountId::from_eth(from),612 data,613 value,614 gas_limit.low_u64(),615 max_fee_per_gas,616 max_priority_fee_per_gas,617 nonce,618 access_list.unwrap_or_default(),619 is_transactional,620 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),621 ).map_err(|err| err.into())622 }623624 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {625 Ethereum::current_transaction_statuses()626 }627628 fn current_block() -> Option<pallet_ethereum::Block> {629 Ethereum::current_block()630 }631632 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {633 Ethereum::current_receipts()634 }635636 fn current_all() -> (637 Option<pallet_ethereum::Block>,638 Option<Vec<pallet_ethereum::Receipt>>,639 Option<Vec<TransactionStatus>>640 ) {641 (642 Ethereum::current_block(),643 Ethereum::current_receipts(),644 Ethereum::current_transaction_statuses()645 )646 }647648 fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {649 xts.into_iter().filter_map(|xt| match xt.0.function {650 Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),651 _ => None652 }).collect()653 }654655 fn elasticity() -> Option<Permill> {656 None657 }658 }659660 impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {661 fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic {662 UncheckedExtrinsic::new_unsigned(663 pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),664 )665 }666 }667668 impl sp_session::SessionKeys<Block> for Runtime {669 fn decode_session_keys(670 encoded: Vec<u8>,671 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {672 SessionKeys::decode_into_raw_public_keys(&encoded)673 }674675 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {676 SessionKeys::generate(seed)677 }678 }679680 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {681 fn slot_duration() -> sp_consensus_aura::SlotDuration {682 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())683 }684685 fn authorities() -> Vec<AuraId> {686 Aura::authorities().to_vec()687 }688 }689690 impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {691 fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {692 ParachainSystem::collect_collation_info(header)693 }694 }695696 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {697 fn account_nonce(account: AccountId) -> Index {698 System::account_nonce(account)699 }700 }701702 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {703 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {704 TransactionPayment::query_info(uxt, len)705 }706 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {707 TransactionPayment::query_fee_details(uxt, len)708 }709 }710711 /*712 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>713 for Runtime714 {715 fn call(716 origin: AccountId,717 dest: AccountId,718 value: Balance,719 gas_limit: u64,720 input_data: Vec<u8>,721 ) -> pallet_contracts_primitives::ContractExecResult {722 Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)723 }724725 fn instantiate(726 origin: AccountId,727 endowment: Balance,728 gas_limit: u64,729 code: pallet_contracts_primitives::Code<Hash>,730 data: Vec<u8>,731 salt: Vec<u8>,732 ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>733 {734 Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)735 }736737 fn get_storage(738 address: AccountId,739 key: [u8; 32],740 ) -> pallet_contracts_primitives::GetStorageResult {741 Contracts::get_storage(address, key)742 }743744 fn rent_projection(745 address: AccountId,746 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {747 Contracts::rent_projection(address)748 }749 }750 */751752 #[cfg(feature = "runtime-benchmarks")]753 impl frame_benchmarking::Benchmark<Block> for Runtime {754 fn benchmark_metadata(extra: bool) -> (755 Vec<frame_benchmarking::BenchmarkList>,756 Vec<frame_support::traits::StorageInfo>,757 ) {758 use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};759 use frame_support::traits::StorageInfoTrait;760761 let mut list = Vec::<BenchmarkList>::new();762763 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);764 list_benchmark!(list, extra, pallet_common, Common);765 list_benchmark!(list, extra, pallet_unique, Unique);766 list_benchmark!(list, extra, pallet_structure, Structure);767 list_benchmark!(list, extra, pallet_inflation, Inflation);768 list_benchmark!(list, extra, pallet_fungible, Fungible);769 list_benchmark!(list, extra, pallet_refungible, Refungible);770 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);771 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);772773 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();774775 return (list, storage_info)776 }777778 fn dispatch_benchmark(779 config: frame_benchmarking::BenchmarkConfig780 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {781 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};782783 let allowlist: Vec<TrackedStorageKey> = vec![784 // Total Issuance785 hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),786787 // Block Number788 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),789 // Execution Phase790 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),791 // Event Count792 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),793 // System Events794 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),795796 // Evm CurrentLogs797 hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),798799 // Transactional depth800 hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),801 ];802803 let mut batches = Vec::<BenchmarkBatch>::new();804 let params = (&config, &allowlist);805806 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);807 add_benchmark!(params, batches, pallet_common, Common);808 add_benchmark!(params, batches, pallet_unique, Unique);809 add_benchmark!(params, batches, pallet_structure, Structure);810 add_benchmark!(params, batches, pallet_inflation, Inflation);811 add_benchmark!(params, batches, pallet_fungible, Fungible);812 add_benchmark!(params, batches, pallet_refungible, Refungible);813 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);814 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);815816 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }817 Ok(batches)818 }819 }820821 #[cfg(feature = "try-runtime")]822 impl frame_try_runtime::TryRuntime<Block> for Runtime {823 fn on_runtime_upgrade() -> (Weight, Weight) {824 log::info!("try-runtime::on_runtime_upgrade unique-chain.");825 let weight = Executive::try_runtime_upgrade().unwrap();826 (weight, RuntimeBlockWeights::get().max_block)827 }828829 fn execute_block_no_check(block: Block) -> Weight {830 Executive::execute_block_no_check(block)831 }832 }833 }834 }835}1#[macro_export]2macro_rules! impl_common_runtime_apis {3 (4 $(5 #![custom_apis]67 $($custom_apis:tt)+8 )?9 ) => {10 impl_runtime_apis! {11 $($($custom_apis)+)?1213 impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {14 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {15 dispatch_unique_runtime!(collection.account_tokens(account))16 }17 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {18 dispatch_unique_runtime!(collection.collection_tokens())19 }20 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {21 dispatch_unique_runtime!(collection.token_exists(token))22 }2324 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {25 dispatch_unique_runtime!(collection.token_owner(token))26 }27 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {28 let budget = up_data_structs::budget::Value::new(10);2930 Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))31 }3233 fn collection_properties(34 collection: CollectionId,35 keys: Option<Vec<Vec<u8>>>36 ) -> Result<Vec<Property>, DispatchError> {37 let keys = keys.map(38 |keys| Common::bytes_keys_to_property_keys(keys)39 ).transpose()?;4041 Common::filter_collection_properties(collection, keys)42 }4344 fn token_properties(45 collection: CollectionId,46 token_id: TokenId,47 keys: Option<Vec<Vec<u8>>>48 ) -> Result<Vec<Property>, DispatchError> {49 let keys = keys.map(50 |keys| Common::bytes_keys_to_property_keys(keys)51 ).transpose()?;5253 dispatch_unique_runtime!(collection.token_properties(token_id, keys))54 }5556 fn property_permissions(57 collection: CollectionId,58 keys: Option<Vec<Vec<u8>>>59 ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {60 let keys = keys.map(61 |keys| Common::bytes_keys_to_property_keys(keys)62 ).transpose()?;6364 Common::filter_property_permissions(collection, keys)65 }6667 fn token_data(68 collection: CollectionId,69 token_id: TokenId,70 keys: Option<Vec<Vec<u8>>>71 ) -> Result<TokenData<CrossAccountId>, DispatchError> {72 let token_data = TokenData {73 properties: Self::token_properties(collection, token_id, keys)?,74 owner: Self::token_owner(collection, token_id)?75 };7677 Ok(token_data)78 }7980 fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {81 dispatch_unique_runtime!(collection.total_supply())82 }83 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {84 dispatch_unique_runtime!(collection.account_balance(account))85 }86 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {87 dispatch_unique_runtime!(collection.balance(account, token))88 }89 fn allowance(90 collection: CollectionId,91 sender: CrossAccountId,92 spender: CrossAccountId,93 token: TokenId,94 ) -> Result<u128, DispatchError> {95 dispatch_unique_runtime!(collection.allowance(sender, spender, token))96 }9798 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {99 Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))100 }101 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {102 Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))103 }104 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {105 Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))106 }107 fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {108 dispatch_unique_runtime!(collection.last_token_id())109 }110 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {111 Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))112 }113 fn collection_stats() -> Result<CollectionStats, DispatchError> {114 Ok(<pallet_common::Pallet<Runtime>>::collection_stats())115 }116 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {117 Ok(<$crate::sponsoring::UniqueSponsorshipPredict<Runtime> as118 $crate::sponsoring::SponsorshipPredict<Runtime>>::predict(119 collection,120 account,121 token))122 }123124 fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {125 Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))126 }127 }128129 /*130 TODO free RMRK!131 impl rmrk_rpc::RmrkApi<132 Block,133 AccountId,134 RmrkCollectionInfo<AccountId>,135 RmrkInstanceInfo<AccountId>,136 RmrkResourceInfo,137 RmrkPropertyInfo,138 RmrkBaseInfo<AccountId>,139 RmrkPartType,140 RmrkTheme141 > for Runtime {142 fn last_collection_idx() -> Result<RmrkCollectionId, DispatchError> {143 Ok(RmrkCore::last_collection_idx())144 }145146 fn collection_by_id(collection_id: RmrkCollectionId) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {147 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, RmrkDecode, RmrkRebind}};148149 let collection_id = CollectionId(collection_id);150 let collection = match RmrkCore::get_typed_nft_collection(collection_id, CollectionType::Regular) {151 Ok(c) => c,152 Err(_) => return Ok(None),153 };154155 let nfts_count = dispatch_unique_runtime!(collection_id.total_supply())?;156157 Ok(Some(RmrkCollectionInfo {158 issuer: collection.owner.clone(),159 metadata: RmrkCore::get_collection_property(collection_id, RmrkProperty::Metadata)?.decode_or_default(),160 max: collection.limits.token_limit,161 symbol: collection.token_prefix.rebind(),162 nfts_count163 }))164 }165166 fn nft_by_id(collection_id: RmrkCollectionId, nft_by_id: RmrkNftId) -> Result<Option<RmrkInstanceInfo<AccountId>>, DispatchError> {167 use up_data_structs::mapping::TokenAddressMapping;168 use pallet_proxy_rmrk_core::{RmrkProperty, misc::RmrkDecode};169170 let collection_id = CollectionId(collection_id);171 let nft_id = TokenId(nft_by_id);172 if !RmrkCore::nft_exists(collection_id, nft_id) { return Ok(None); }173174 let owner = match dispatch_unique_runtime!(collection_id.token_owner(nft_id))? {175 Some(owner) => match <Runtime as pallet_common::Config>::CrossTokenAddressMapping::address_to_token(&owner) {176 Some((col, tok)) => RmrkAccountIdOrCollectionNftTuple::CollectionAndNftTuple(col.0, tok.0),177 None => RmrkAccountIdOrCollectionNftTuple::AccountId(owner.as_sub().clone())178 },179 None => return Ok(None)180 };181182 let allowance = pallet_nonfungible::Allowance::<Runtime>::get((collection_id, nft_id));183184 Ok(Some(RmrkInstanceInfo {185 owner: owner,186 royalty: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::RoyaltyInfo)?.decode_or_default(),187 metadata: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::Metadata)?.decode_or_default(),188 equipped: RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::Equipped)?.decode_or_default(),189 pending: allowance.is_some(),190 }))191 }192193 fn account_tokens(account_id: AccountId, collection_id: RmrkCollectionId) -> Result<Vec<RmrkNftId>, DispatchError> {194 use pallet_proxy_rmrk_core::misc::CollectionType;195196 let cross_account_id = CrossAccountId::from_sub(account_id);197 let collection_id = CollectionId(collection_id);198 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() { return Ok(Vec::new()); }199200 Ok(201 dispatch_unique_runtime!(collection_id.account_tokens(cross_account_id))?202 .into_iter()203 .map(|token| token.0)204 .collect()205 )206 }207208 fn nft_children(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkNftChild>, DispatchError> {209 let collection_id = CollectionId(collection_id);210 let nft_id = TokenId(nft_id);211 if !RmrkCore::nft_exists(collection_id, nft_id) { return Ok(Vec::new()); }212213 Ok(214 pallet_nonfungible::TokenChildren::<Runtime>::iter_prefix((collection_id, nft_id))215 .filter_map(|(child_id, is_child)|216 match is_child {217 true => Some(RmrkNftChild {218 collection_id: child_id.0.0,219 nft_id: child_id.1.0,220 }),221 false => None,222 }223 ).collect()224 )225 }226227 fn collection_properties(collection_id: RmrkCollectionId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {228 use pallet_proxy_rmrk_core::misc::CollectionType;229230 let collection_id = CollectionId(collection_id);231 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Regular).is_err() {232 return Ok(Vec::new());233 }234235 let properties = RmrkCore::filter_user_properties(236 collection_id,237 /* token_id = */ None,238 filter_keys,239 |key, value| RmrkPropertyInfo {240 key,241 value242 }243 )?;244245 Ok(properties)246 }247248 fn nft_properties(collection_id: RmrkCollectionId, nft_id: RmrkNftId, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Vec<RmrkPropertyInfo>, DispatchError> {249 use pallet_proxy_rmrk_core::misc::NftType;250251 let collection_id = CollectionId(collection_id);252 let token_id = TokenId(nft_id);253254 if RmrkCore::ensure_nft_type(collection_id, token_id, NftType::Regular).is_err() {255 return Ok(Vec::new());256 }257258 let properties = RmrkCore::filter_user_properties(259 collection_id,260 Some(token_id),261 filter_keys,262 |key, value| RmrkPropertyInfo {263 key,264 value265 }266 )?;267268 Ok(properties)269 }270271 fn nft_resources(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceInfo>, DispatchError> {272 use frame_support::BoundedVec;273 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};274275 let collection_id = CollectionId(collection_id);276 if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo make sure the collection type doesn't matter277278 let nft_id = TokenId(nft_id);279 if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }280281 let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)282 .unwrap()283 .decode_or_default();284 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Resource).is_err() { return Ok(Vec::new()); }285286 let resources = pallet_nonfungible::TokenProperties::<Runtime>::iter_prefix((resource_collection_id,))287 .filter_map(|(resource_id, properties)| Some(RmrkResourceInfo {288 id: BoundedVec::default(), // todo ResourceId property289 pending: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceAccept).unwrap().decode_or_default(),290 pending_removal: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::PendingResourceRemoval).unwrap().decode_or_default(),291 resource: RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::ResourceType).unwrap().decode_or_default(),/* {292 RmrkResourceTypes::Basic(resource) => RmrkResourceTypes::Basic(),/*(RmrkBasicResource {293 src: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Src).unwrap().decode_or_default(),294 metadata: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Metadata).unwrap().decode_or_default(),295 license: RmrkCore::get_nft_property_inner(properties, RmrkProperty::License).unwrap().decode_or_default(),296 thumb: RmrkCore::get_nft_property_inner(properties, RmrkProperty::Thumb).unwrap().decode_or_default(),297 },*///BasicResource<BoundedString>)298 _ => todo!(), //RmrkResourceTypes::Composable(ComposableResource<BoundedString, BoundedParts>),299 //RmrkResourceTypes::Slot(SlotResource<BoundedString>),300 },*/301 }))302 .collect();303304 Ok(resources)305 }306307 fn nft_resource_priorities(collection_id: RmrkCollectionId, nft_id: RmrkNftId) -> Result<Vec<RmrkResourceId>, DispatchError> {308 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};309310 let collection_id = CollectionId(collection_id);311 if !RmrkCore::collection_exists(collection_id) { return Ok(Vec::new()); } // todo ensure the collection type doesn't matter312313 let nft_id = TokenId(nft_id);314 if RmrkCore::ensure_nft_type(collection_id, nft_id, NftType::Resource).is_err() { return Ok(Vec::new()); }315316 /*let resource_collection_id: CollectionId = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourceCollection)317 .unwrap()318 .decode_or_default();319 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Resource).is_err() { return Ok(Vec::new()); }320321 let resources = pallet_nonfungible::TokenProperties::<Runtime>::iter_prefix((resource_collection_id,))322 .filter_map(|(resource_id, properties)| Some((323 resource_id, // ResourceId property324 RmrkCore::get_nft_property(resource_collection_id, resource_id, RmrkProperty::Priority).unwrap().decode_or_default(),325 )))326 .collect()327 .sort_by_key(|(_, index)| *index)328 .into_iter().map(|(resource_id, _)| resource_id)*/329 let priorities = RmrkCore::get_nft_property(collection_id, nft_id, RmrkProperty::ResourcePriorities)?.decode_or_default();330331 Ok(priorities)332 }333334 fn base(base_id: RmrkBaseId) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {335 use pallet_proxy_rmrk_core::{336 RmrkProperty, misc::{CollectionType, RmrkDecode, RmrkRebind},337 };338339 let collection_id = CollectionId(base_id);340 let collection = match RmrkCore::get_typed_nft_collection(collection_id, CollectionType::Base) {341 Ok(c) => c,342 Err(_) => return Ok(None),343 };344345 Ok(Some(RmrkBaseInfo {346 issuer: collection.owner.clone(),347 base_type: RmrkCore::get_collection_property(collection_id, RmrkProperty::BaseType)?.decode_or_default(),348 symbol: collection.token_prefix.rebind(),349 }))350 }351352 fn base_parts(base_id: RmrkBaseId) -> Result<Vec<RmrkPartType>, DispatchError> {353 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, NftType, RmrkDecode}};354355 let collection_id = CollectionId(base_id);356 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() { return Ok(Vec::new()); }357358 let parts = dispatch_unique_runtime!(collection_id.collection_tokens())?359 .into_iter()360 .filter_map(|token_id| {361 let nft_type = RmrkCore::get_nft_type(collection_id, token_id).ok()?;362363 match nft_type {364 NftType::FixedPart => Some(RmrkPartType::FixedPart(RmrkFixedPart {365 id: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ExternalPartId).ok()?.decode_or_default(),366 src: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::Src).ok()?.decode_or_default(),367 z: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ZIndex).ok()?.decode_or_default(),368 })),369 NftType::SlotPart => Some(RmrkPartType::SlotPart(RmrkSlotPart {370 id: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ExternalPartId).ok()?.decode_or_default(),371 src: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::Src).ok()?.decode_or_default(),372 z: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::ZIndex).ok()?.decode_or_default(),373 equippable: RmrkCore::get_nft_property(collection_id, token_id, RmrkProperty::EquippableList).ok()?.decode_or_default(),374 })),375 _ => None376 }377 })378 .collect();379380 Ok(parts)381 }382383 fn theme_names(base_id: RmrkBaseId) -> Result<Vec<RmrkThemeName>, DispatchError> {384 use pallet_proxy_rmrk_core::{RmrkProperty, misc::{CollectionType, RmrkDecode}};385386 let collection_id = CollectionId(base_id);387 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() {388 return Ok(Vec::new());389 }390391 let theme_names = dispatch_unique_runtime!(collection_id.collection_tokens())?392 .iter()393 .filter_map(|token_id| {394 let nft_type = RmrkCore::get_nft_type(collection_id, *token_id).unwrap();395396 match nft_type {397 Theme => Some(398 RmrkCore::get_nft_property(collection_id, *token_id, RmrkProperty::ThemeName).unwrap().decode_or_default()399 ),400 _ => None401 }402 })403 .collect();404405 Ok(theme_names)406 }407408 fn theme(base_id: RmrkBaseId, theme_name: RmrkThemeName, filter_keys: Option<Vec<RmrkPropertyKey>>) -> Result<Option<RmrkTheme>, DispatchError> {409 use pallet_proxy_rmrk_core::{410 RmrkProperty,411 misc::{CollectionType, NftType, RmrkDecode}412 };413414 let collection_id = CollectionId(base_id);415 if RmrkCore::ensure_collection_type(collection_id, CollectionType::Base).is_err() {416 return Ok(None);417 }418419 let theme_info = dispatch_unique_runtime!(collection_id.collection_tokens())?420 .into_iter()421 .find_map(|token_id| {422 RmrkCore::ensure_nft_type(collection_id, token_id, NftType::Theme).ok()?;423424 let name: RmrkString = RmrkCore::get_nft_property(425 collection_id, token_id, RmrkProperty::ThemeName426 ).ok()?.decode_or_default();427428 if name == theme_name {429 Some((name, token_id))430 } else {431 None432 }433 });434435 let (name, theme_id) = match theme_info {436 Some((name, theme_id)) => (name, theme_id),437 None => return Ok(None)438 };439440 let properties = RmrkCore::filter_user_properties(441 collection_id,442 Some(theme_id),443 filter_keys,444 |key, value| RmrkThemeProperty {445 key,446 value447 }448 )?;449450 let inherit = RmrkCore::get_nft_property(451 collection_id,452 theme_id,453 RmrkProperty::ThemeInherit454 )?.decode_or_default();455456 let theme = RmrkTheme {457 name,458 properties,459 inherit,460 };461462 Ok(Some(theme))463 }464 }*/465466 impl sp_api::Core<Block> for Runtime {467 fn version() -> RuntimeVersion {468 VERSION469 }470471 fn execute_block(block: Block) {472 Executive::execute_block(block)473 }474475 fn initialize_block(header: &<Block as BlockT>::Header) {476 Executive::initialize_block(header)477 }478 }479480 impl sp_api::Metadata<Block> for Runtime {481 fn metadata() -> OpaqueMetadata {482 OpaqueMetadata::new(Runtime::metadata().into())483 }484 }485486 impl sp_block_builder::BlockBuilder<Block> for Runtime {487 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {488 Executive::apply_extrinsic(extrinsic)489 }490491 fn finalize_block() -> <Block as BlockT>::Header {492 Executive::finalize_block()493 }494495 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {496 data.create_extrinsics()497 }498499 fn check_inherents(500 block: Block,501 data: sp_inherents::InherentData,502 ) -> sp_inherents::CheckInherentsResult {503 data.check_extrinsics(&block)504 }505506 // fn random_seed() -> <Block as BlockT>::Hash {507 // RandomnessCollectiveFlip::random_seed().0508 // }509 }510511 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {512 fn validate_transaction(513 source: TransactionSource,514 tx: <Block as BlockT>::Extrinsic,515 hash: <Block as BlockT>::Hash,516 ) -> TransactionValidity {517 Executive::validate_transaction(source, tx, hash)518 }519 }520521 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {522 fn offchain_worker(header: &<Block as BlockT>::Header) {523 Executive::offchain_worker(header)524 }525 }526527 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {528 fn chain_id() -> u64 {529 <Runtime as pallet_evm::Config>::ChainId::get()530 }531532 fn account_basic(address: H160) -> EVMAccount {533 EVM::account_basic(&address)534 }535536 fn gas_price() -> U256 {537 <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price()538 }539540 fn account_code_at(address: H160) -> Vec<u8> {541 EVM::account_codes(address)542 }543544 fn author() -> H160 {545 <pallet_evm::Pallet<Runtime>>::find_author()546 }547548 fn storage_at(address: H160, index: U256) -> H256 {549 let mut tmp = [0u8; 32];550 index.to_big_endian(&mut tmp);551 EVM::account_storages(address, H256::from_slice(&tmp[..]))552 }553554 #[allow(clippy::redundant_closure)]555 fn call(556 from: H160,557 to: H160,558 data: Vec<u8>,559 value: U256,560 gas_limit: U256,561 max_fee_per_gas: Option<U256>,562 max_priority_fee_per_gas: Option<U256>,563 nonce: Option<U256>,564 estimate: bool,565 access_list: Option<Vec<(H160, Vec<H256>)>>,566 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {567 let config = if estimate {568 let mut config = <Runtime as pallet_evm::Config>::config().clone();569 config.estimate = true;570 Some(config)571 } else {572 None573 };574575 let is_transactional = false;576 <Runtime as pallet_evm::Config>::Runner::call(577 CrossAccountId::from_eth(from),578 to,579 data,580 value,581 gas_limit.low_u64(),582 max_fee_per_gas,583 max_priority_fee_per_gas,584 nonce,585 access_list.unwrap_or_default(),586 is_transactional,587 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),588 ).map_err(|err| err.into())589 }590591 #[allow(clippy::redundant_closure)]592 fn create(593 from: H160,594 data: Vec<u8>,595 value: U256,596 gas_limit: U256,597 max_fee_per_gas: Option<U256>,598 max_priority_fee_per_gas: Option<U256>,599 nonce: Option<U256>,600 estimate: bool,601 access_list: Option<Vec<(H160, Vec<H256>)>>,602 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {603 let config = if estimate {604 let mut config = <Runtime as pallet_evm::Config>::config().clone();605 config.estimate = true;606 Some(config)607 } else {608 None609 };610611 let is_transactional = false;612 <Runtime as pallet_evm::Config>::Runner::create(613 CrossAccountId::from_eth(from),614 data,615 value,616 gas_limit.low_u64(),617 max_fee_per_gas,618 max_priority_fee_per_gas,619 nonce,620 access_list.unwrap_or_default(),621 is_transactional,622 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),623 ).map_err(|err| err.into())624 }625626 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {627 Ethereum::current_transaction_statuses()628 }629630 fn current_block() -> Option<pallet_ethereum::Block> {631 Ethereum::current_block()632 }633634 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {635 Ethereum::current_receipts()636 }637638 fn current_all() -> (639 Option<pallet_ethereum::Block>,640 Option<Vec<pallet_ethereum::Receipt>>,641 Option<Vec<TransactionStatus>>642 ) {643 (644 Ethereum::current_block(),645 Ethereum::current_receipts(),646 Ethereum::current_transaction_statuses()647 )648 }649650 fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {651 xts.into_iter().filter_map(|xt| match xt.0.function {652 Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),653 _ => None654 }).collect()655 }656657 fn elasticity() -> Option<Permill> {658 None659 }660 }661662 impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {663 fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic {664 UncheckedExtrinsic::new_unsigned(665 pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),666 )667 }668 }669670 impl sp_session::SessionKeys<Block> for Runtime {671 fn decode_session_keys(672 encoded: Vec<u8>,673 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {674 SessionKeys::decode_into_raw_public_keys(&encoded)675 }676677 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {678 SessionKeys::generate(seed)679 }680 }681682 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {683 fn slot_duration() -> sp_consensus_aura::SlotDuration {684 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())685 }686687 fn authorities() -> Vec<AuraId> {688 Aura::authorities().to_vec()689 }690 }691692 impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {693 fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {694 ParachainSystem::collect_collation_info(header)695 }696 }697698 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {699 fn account_nonce(account: AccountId) -> Index {700 System::account_nonce(account)701 }702 }703704 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {705 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {706 TransactionPayment::query_info(uxt, len)707 }708 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {709 TransactionPayment::query_fee_details(uxt, len)710 }711 }712713 /*714 impl pallet_contracts_rpc_runtime_api::ContractsApi<Block, AccountId, Balance, BlockNumber, Hash>715 for Runtime716 {717 fn call(718 origin: AccountId,719 dest: AccountId,720 value: Balance,721 gas_limit: u64,722 input_data: Vec<u8>,723 ) -> pallet_contracts_primitives::ContractExecResult {724 Contracts::bare_call(origin, dest, value, gas_limit, input_data, false)725 }726727 fn instantiate(728 origin: AccountId,729 endowment: Balance,730 gas_limit: u64,731 code: pallet_contracts_primitives::Code<Hash>,732 data: Vec<u8>,733 salt: Vec<u8>,734 ) -> pallet_contracts_primitives::ContractInstantiateResult<AccountId, BlockNumber>735 {736 Contracts::bare_instantiate(origin, endowment, gas_limit, code, data, salt, true, false)737 }738739 fn get_storage(740 address: AccountId,741 key: [u8; 32],742 ) -> pallet_contracts_primitives::GetStorageResult {743 Contracts::get_storage(address, key)744 }745746 fn rent_projection(747 address: AccountId,748 ) -> pallet_contracts_primitives::RentProjectionResult<BlockNumber> {749 Contracts::rent_projection(address)750 }751 }752 */753754 #[cfg(feature = "runtime-benchmarks")]755 impl frame_benchmarking::Benchmark<Block> for Runtime {756 fn benchmark_metadata(extra: bool) -> (757 Vec<frame_benchmarking::BenchmarkList>,758 Vec<frame_support::traits::StorageInfo>,759 ) {760 use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};761 use frame_support::traits::StorageInfoTrait;762763 let mut list = Vec::<BenchmarkList>::new();764765 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);766 list_benchmark!(list, extra, pallet_common, Common);767 list_benchmark!(list, extra, pallet_unique, Unique);768 list_benchmark!(list, extra, pallet_structure, Structure);769 list_benchmark!(list, extra, pallet_inflation, Inflation);770 list_benchmark!(list, extra, pallet_fungible, Fungible);771 list_benchmark!(list, extra, pallet_refungible, Refungible);772 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);773 // list_benchmark!(list, extra, pallet_evm_coder_substrate, EvmCoderSubstrate);774775 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();776777 return (list, storage_info)778 }779780 fn dispatch_benchmark(781 config: frame_benchmarking::BenchmarkConfig782 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {783 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};784785 let allowlist: Vec<TrackedStorageKey> = vec![786 // Total Issuance787 hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),788789 // Block Number790 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),791 // Execution Phase792 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),793 // Event Count794 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),795 // System Events796 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),797798 // Evm CurrentLogs799 hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),800801 // Transactional depth802 hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),803 ];804805 let mut batches = Vec::<BenchmarkBatch>::new();806 let params = (&config, &allowlist);807808 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);809 add_benchmark!(params, batches, pallet_common, Common);810 add_benchmark!(params, batches, pallet_unique, Unique);811 add_benchmark!(params, batches, pallet_structure, Structure);812 add_benchmark!(params, batches, pallet_inflation, Inflation);813 add_benchmark!(params, batches, pallet_fungible, Fungible);814 add_benchmark!(params, batches, pallet_refungible, Refungible);815 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);816 // add_benchmark!(params, batches, pallet_evm_coder_substrate, EvmCoderSubstrate);817818 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }819 Ok(batches)820 }821 }822823 #[cfg(feature = "try-runtime")]824 impl frame_try_runtime::TryRuntime<Block> for Runtime {825 fn on_runtime_upgrade() -> (Weight, Weight) {826 log::info!("try-runtime::on_runtime_upgrade unique-chain.");827 let weight = Executive::try_runtime_upgrade().unwrap();828 (weight, RuntimeBlockWeights::get().max_block)829 }830831 fn execute_block_no_check(block: Block) -> Weight {832 Executive::execute_block_no_check(block)833 }834 }835 }836 }837}runtime/opal/src/lib.rsdiffbeforeafterboth--- a/runtime/opal/src/lib.rs
+++ b/runtime/opal/src/lib.rs
@@ -903,13 +903,15 @@
type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
}
+/*
+TODO free RMRK!
impl pallet_proxy_rmrk_core::Config for Runtime {
type Event = Event;
}
impl pallet_proxy_rmrk_equip::Config for Runtime {
type Event = Event;
-}
+}*/
impl pallet_unique::Config for Runtime {
type Event = Event;
@@ -1032,8 +1034,10 @@
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
+ /* TODO free RMRK!
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,
runtime/quartz/src/lib.rsdiffbeforeafterboth--- a/runtime/quartz/src/lib.rs
+++ b/runtime/quartz/src/lib.rs
@@ -887,14 +887,14 @@
impl pallet_nonfungible::Config for Runtime {
type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
}
-
+/* TODO free RMRK!
impl pallet_proxy_rmrk_core::Config for Runtime {
type Event = Event;
}
impl pallet_proxy_rmrk_equip::Config for Runtime {
type Event = Event;
-}
+}*/
impl pallet_unique::Config for Runtime {
type Event = Event;
@@ -1017,8 +1017,9 @@
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
+ /* TODO free RMRK!
RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
- RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+ RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,*/
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
runtime/unique/src/lib.rsdiffbeforeafterboth--- a/runtime/unique/src/lib.rs
+++ b/runtime/unique/src/lib.rs
@@ -892,14 +892,14 @@
impl pallet_nonfungible::Config for Runtime {
type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
}
-
+/* TODO free RMRK!
impl pallet_proxy_rmrk_core::Config for Runtime {
type Event = Event;
}
impl pallet_proxy_rmrk_equip::Config for Runtime {
type Event = Event;
-}
+}*/
impl pallet_unique::Config for Runtime {
type Event = Event;
@@ -1022,8 +1022,9 @@
Refungible: pallet_refungible::{Pallet, Storage} = 68,
Nonfungible: pallet_nonfungible::{Pallet, Storage} = 69,
Structure: pallet_structure::{Pallet, Call, Storage, Event<T>} = 70,
+ /* TODO free RMRK!
RmrkCore: pallet_proxy_rmrk_core::{Pallet, Call, Storage, Event<T>} = 71,
- RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
+ RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,*/
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,