1234567891011121314151617#[macro_export]18macro_rules! impl_common_runtime_apis {19 (20 $(21 #![custom_apis]2223 $($custom_apis:tt)+24 )?25 ) => {26 impl_runtime_apis! {27 $($($custom_apis)+)?2829 impl up_rpc::UniqueApi<Block, CrossAccountId, AccountId> for Runtime {30 fn account_tokens(collection: CollectionId, account: CrossAccountId) -> Result<Vec<TokenId>, DispatchError> {31 dispatch_unique_runtime!(collection.account_tokens(account))32 }33 fn collection_tokens(collection: CollectionId) -> Result<Vec<TokenId>, DispatchError> {34 dispatch_unique_runtime!(collection.collection_tokens())35 }36 fn token_exists(collection: CollectionId, token: TokenId) -> Result<bool, DispatchError> {37 dispatch_unique_runtime!(collection.token_exists(token))38 }3940 fn token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {41 dispatch_unique_runtime!(collection.token_owner(token))42 }4344 fn token_owners(collection: CollectionId, token: TokenId) -> Result<Vec::<CrossAccountId>, DispatchError> {45 dispatch_unique_runtime!(collection.token_owners(token))46 }4748 fn topmost_token_owner(collection: CollectionId, token: TokenId) -> Result<Option<CrossAccountId>, DispatchError> {49 let budget = up_data_structs::budget::Value::new(10);5051 Ok(Some(<pallet_structure::Pallet<Runtime>>::find_topmost_owner(collection, token, &budget)?))52 }53 fn token_children(collection: CollectionId, token: TokenId) -> Result<Vec<TokenChild>, DispatchError> {54 Ok(<pallet_nonfungible::Pallet<Runtime>>::token_children_ids(collection, token))55 }56 fn collection_properties(57 collection: CollectionId,58 keys: Option<Vec<Vec<u8>>>59 ) -> Result<Vec<Property>, DispatchError> {60 let keys = keys.map(61 |keys| Common::bytes_keys_to_property_keys(keys)62 ).transpose()?;6364 Common::filter_collection_properties(collection, keys)65 }6667 fn token_properties(68 collection: CollectionId,69 token_id: TokenId,70 keys: Option<Vec<Vec<u8>>>71 ) -> Result<Vec<Property>, DispatchError> {72 let keys = keys.map(73 |keys| Common::bytes_keys_to_property_keys(keys)74 ).transpose()?;7576 dispatch_unique_runtime!(collection.token_properties(token_id, keys))77 }7879 fn property_permissions(80 collection: CollectionId,81 keys: Option<Vec<Vec<u8>>>82 ) -> Result<Vec<PropertyKeyPermission>, DispatchError> {83 let keys = keys.map(84 |keys| Common::bytes_keys_to_property_keys(keys)85 ).transpose()?;8687 Common::filter_property_permissions(collection, keys)88 }8990 fn token_data(91 collection: CollectionId,92 token_id: TokenId,93 keys: Option<Vec<Vec<u8>>>94 ) -> Result<TokenData<CrossAccountId>, DispatchError> {95 let token_data = TokenData {96 properties: Self::token_properties(collection, token_id, keys)?,97 owner: Self::token_owner(collection, token_id)?,98 pieces: Self::total_pieces(collection, token_id)?.unwrap_or(0),99 };100101 Ok(token_data)102 }103104 fn total_supply(collection: CollectionId) -> Result<u32, DispatchError> {105 dispatch_unique_runtime!(collection.total_supply())106 }107 fn account_balance(collection: CollectionId, account: CrossAccountId) -> Result<u32, DispatchError> {108 dispatch_unique_runtime!(collection.account_balance(account))109 }110 fn balance(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<u128, DispatchError> {111 dispatch_unique_runtime!(collection.balance(account, token))112 }113 fn allowance(114 collection: CollectionId,115 sender: CrossAccountId,116 spender: CrossAccountId,117 token: TokenId,118 ) -> Result<u128, DispatchError> {119 dispatch_unique_runtime!(collection.allowance(sender, spender, token))120 }121122 fn adminlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {123 Ok(<pallet_common::Pallet<Runtime>>::adminlist(collection))124 }125 fn allowlist(collection: CollectionId) -> Result<Vec<CrossAccountId>, DispatchError> {126 Ok(<pallet_common::Pallet<Runtime>>::allowlist(collection))127 }128 fn allowed(collection: CollectionId, user: CrossAccountId) -> Result<bool, DispatchError> {129 Ok(<pallet_common::Pallet<Runtime>>::allowed(collection, user))130 }131 fn last_token_id(collection: CollectionId) -> Result<TokenId, DispatchError> {132 dispatch_unique_runtime!(collection.last_token_id())133 }134 fn collection_by_id(collection: CollectionId) -> Result<Option<RpcCollection<AccountId>>, DispatchError> {135 Ok(<pallet_common::Pallet<Runtime>>::rpc_collection(collection))136 }137 fn collection_stats() -> Result<CollectionStats, DispatchError> {138 Ok(<pallet_common::Pallet<Runtime>>::collection_stats())139 }140 fn next_sponsored(collection: CollectionId, account: CrossAccountId, token: TokenId) -> Result<Option<u64>, DispatchError> {141 Ok(<$crate::sponsoring::UniqueSponsorshipPredict<Runtime> as142 $crate::sponsoring::SponsorshipPredict<Runtime>>::predict(143 collection,144 account,145 token))146 }147148 fn effective_collection_limits(collection: CollectionId) -> Result<Option<CollectionLimits>, DispatchError> {149 Ok(<pallet_common::Pallet<Runtime>>::effective_collection_limits(collection))150 }151152 fn total_pieces(collection: CollectionId, token_id: TokenId) -> Result<Option<u128>, DispatchError> {153 dispatch_unique_runtime!(collection.total_pieces(token_id))154 }155 }156157 impl rmrk_rpc::RmrkApi<158 Block,159 AccountId,160 RmrkCollectionInfo<AccountId>,161 RmrkInstanceInfo<AccountId>,162 RmrkResourceInfo,163 RmrkPropertyInfo,164 RmrkBaseInfo<AccountId>,165 RmrkPartType,166 RmrkTheme167 > 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>();171172 #[cfg(not(feature = "rmrk"))]173 return Ok(Default::default());174 }175176 fn collection_by_id(177 #[allow(unused_variables)]178 collection_id: RmrkCollectionId179 ) -> Result<Option<RmrkCollectionInfo<AccountId>>, DispatchError> {180 #[cfg(feature = "rmrk")]181 return pallet_proxy_rmrk_core::rpc::collection_by_id::<Runtime>(collection_id);182183 #[cfg(not(feature = "rmrk"))]184 return Ok(Default::default())185 }186187 fn nft_by_id(188 #[allow(unused_variables)]189 collection_id: RmrkCollectionId,190191 #[allow(unused_variables)]192 nft_by_id: RmrkNftId193 ) -> 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);196197 #[cfg(not(feature = "rmrk"))]198 return Ok(Default::default())199 }200201 fn account_tokens(202 #[allow(unused_variables)]203 account_id: AccountId,204205 #[allow(unused_variables)]206 collection_id: RmrkCollectionId207 ) -> Result<Vec<RmrkNftId>, DispatchError> {208 #[cfg(feature = "rmrk")]209 return pallet_proxy_rmrk_core::rpc::account_tokens::<Runtime>(account_id, collection_id);210211 #[cfg(not(feature = "rmrk"))]212 return Ok(Default::default())213 }214215 fn nft_children(216 #[allow(unused_variables)]217 collection_id: RmrkCollectionId,218219 #[allow(unused_variables)]220 nft_id: RmrkNftId221 ) -> Result<Vec<RmrkNftChild>, DispatchError> {222 #[cfg(feature = "rmrk")]223 return pallet_proxy_rmrk_core::rpc::nft_children::<Runtime>(collection_id, nft_id);224225 #[cfg(not(feature = "rmrk"))]226 return Ok(Default::default())227 }228229 fn collection_properties(230 #[allow(unused_variables)]231 collection_id: RmrkCollectionId,232233 #[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);238239 #[cfg(not(feature = "rmrk"))]240 return Ok(Default::default())241 }242243 fn nft_properties(244 #[allow(unused_variables)]245 collection_id: RmrkCollectionId,246247 #[allow(unused_variables)]248 nft_id: RmrkNftId,249250 #[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);255256 #[cfg(not(feature = "rmrk"))]257 return Ok(Default::default())258 }259260 fn nft_resources(261 #[allow(unused_variables)]262 collection_id: RmrkCollectionId,263264 #[allow(unused_variables)]265 nft_id: RmrkNftId266 ) -> Result<Vec<RmrkResourceInfo>, DispatchError> {267 #[cfg(feature = "rmrk")]268 return pallet_proxy_rmrk_core::rpc::nft_resources::<Runtime>(collection_id, nft_id);269270 #[cfg(not(feature = "rmrk"))]271 return Ok(Default::default())272 }273274 fn nft_resource_priority(275 #[allow(unused_variables)]276 collection_id: RmrkCollectionId,277278 #[allow(unused_variables)]279 nft_id: RmrkNftId,280281 #[allow(unused_variables)]282 resource_id: RmrkResourceId283 ) -> 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);286287 #[cfg(not(feature = "rmrk"))]288 return Ok(Default::default())289 }290291 fn base(292 #[allow(unused_variables)]293 base_id: RmrkBaseId294 ) -> Result<Option<RmrkBaseInfo<AccountId>>, DispatchError> {295 #[cfg(feature = "rmrk")]296 return pallet_proxy_rmrk_equip::rpc::base::<Runtime>(base_id);297298 #[cfg(not(feature = "rmrk"))]299 return Ok(Default::default())300 }301302 fn base_parts(303 #[allow(unused_variables)]304 base_id: RmrkBaseId305 ) -> Result<Vec<RmrkPartType>, DispatchError> {306 #[cfg(feature = "rmrk")]307 return pallet_proxy_rmrk_equip::rpc::base_parts::<Runtime>(base_id);308309 #[cfg(not(feature = "rmrk"))]310 return Ok(Default::default())311 }312313 fn theme_names(314 #[allow(unused_variables)]315 base_id: RmrkBaseId316 ) -> Result<Vec<RmrkThemeName>, DispatchError> {317 #[cfg(feature = "rmrk")]318 return pallet_proxy_rmrk_equip::rpc::theme_names::<Runtime>(base_id);319320 #[cfg(not(feature = "rmrk"))]321 Ok(Default::default())322 }323324 fn theme(325 #[allow(unused_variables)]326 base_id: RmrkBaseId,327328 #[allow(unused_variables)]329 theme_name: RmrkThemeName,330331 #[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);336337 #[cfg(not(feature = "rmrk"))]338 return Ok(Default::default())339 }340 }341342 impl sp_api::Core<Block> for Runtime {343 fn version() -> RuntimeVersion {344 VERSION345 }346347 fn execute_block(block: Block) {348 Executive::execute_block(block)349 }350351 fn initialize_block(header: &<Block as BlockT>::Header) {352 Executive::initialize_block(header)353 }354 }355356 impl sp_api::Metadata<Block> for Runtime {357 fn metadata() -> OpaqueMetadata {358 OpaqueMetadata::new(Runtime::metadata().into())359 }360 }361362 impl sp_block_builder::BlockBuilder<Block> for Runtime {363 fn apply_extrinsic(extrinsic: <Block as BlockT>::Extrinsic) -> ApplyExtrinsicResult {364 Executive::apply_extrinsic(extrinsic)365 }366367 fn finalize_block() -> <Block as BlockT>::Header {368 Executive::finalize_block()369 }370371 fn inherent_extrinsics(data: sp_inherents::InherentData) -> Vec<<Block as BlockT>::Extrinsic> {372 data.create_extrinsics()373 }374375 fn check_inherents(376 block: Block,377 data: sp_inherents::InherentData,378 ) -> sp_inherents::CheckInherentsResult {379 data.check_extrinsics(&block)380 }381382 383 384 385 }386387 impl sp_transaction_pool::runtime_api::TaggedTransactionQueue<Block> for Runtime {388 fn validate_transaction(389 source: TransactionSource,390 tx: <Block as BlockT>::Extrinsic,391 hash: <Block as BlockT>::Hash,392 ) -> TransactionValidity {393 Executive::validate_transaction(source, tx, hash)394 }395 }396397 impl sp_offchain::OffchainWorkerApi<Block> for Runtime {398 fn offchain_worker(header: &<Block as BlockT>::Header) {399 Executive::offchain_worker(header)400 }401 }402403 impl fp_rpc::EthereumRuntimeRPCApi<Block> for Runtime {404 fn chain_id() -> u64 {405 <Runtime as pallet_evm::Config>::ChainId::get()406 }407408 fn account_basic(address: H160) -> EVMAccount {409 let (account, _) = EVM::account_basic(&address);410 account411 }412413 fn gas_price() -> U256 {414 let (price, _) = <Runtime as pallet_evm::Config>::FeeCalculator::min_gas_price();415 price416 }417418 fn account_code_at(address: H160) -> Vec<u8> {419 EVM::account_codes(address)420 }421422 fn author() -> H160 {423 <pallet_evm::Pallet<Runtime>>::find_author()424 }425426 fn storage_at(address: H160, index: U256) -> H256 {427 let mut tmp = [0u8; 32];428 index.to_big_endian(&mut tmp);429 EVM::account_storages(address, H256::from_slice(&tmp[..]))430 }431432 #[allow(clippy::redundant_closure)]433 fn call(434 from: H160,435 to: H160,436 data: Vec<u8>,437 value: U256,438 gas_limit: U256,439 max_fee_per_gas: Option<U256>,440 max_priority_fee_per_gas: Option<U256>,441 nonce: Option<U256>,442 estimate: bool,443 access_list: Option<Vec<(H160, Vec<H256>)>>,444 ) -> Result<pallet_evm::CallInfo, sp_runtime::DispatchError> {445 let config = if estimate {446 let mut config = <Runtime as pallet_evm::Config>::config().clone();447 config.estimate = true;448 Some(config)449 } else {450 None451 };452453 let is_transactional = false;454 <Runtime as pallet_evm::Config>::Runner::call(455 CrossAccountId::from_eth(from),456 to,457 data,458 value,459 gas_limit.low_u64(),460 max_fee_per_gas,461 max_priority_fee_per_gas,462 nonce,463 access_list.unwrap_or_default(),464 is_transactional,465 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),466 ).map_err(|err| err.error.into())467 }468469 #[allow(clippy::redundant_closure)]470 fn create(471 from: H160,472 data: Vec<u8>,473 value: U256,474 gas_limit: U256,475 max_fee_per_gas: Option<U256>,476 max_priority_fee_per_gas: Option<U256>,477 nonce: Option<U256>,478 estimate: bool,479 access_list: Option<Vec<(H160, Vec<H256>)>>,480 ) -> Result<pallet_evm::CreateInfo, sp_runtime::DispatchError> {481 let config = if estimate {482 let mut config = <Runtime as pallet_evm::Config>::config().clone();483 config.estimate = true;484 Some(config)485 } else {486 None487 };488489 let is_transactional = false;490 <Runtime as pallet_evm::Config>::Runner::create(491 CrossAccountId::from_eth(from),492 data,493 value,494 gas_limit.low_u64(),495 max_fee_per_gas,496 max_priority_fee_per_gas,497 nonce,498 access_list.unwrap_or_default(),499 is_transactional,500 config.as_ref().unwrap_or_else(|| <Runtime as pallet_evm::Config>::config()),501 ).map_err(|err| err.error.into())502 }503504 fn current_transaction_statuses() -> Option<Vec<TransactionStatus>> {505 Ethereum::current_transaction_statuses()506 }507508 fn current_block() -> Option<pallet_ethereum::Block> {509 Ethereum::current_block()510 }511512 fn current_receipts() -> Option<Vec<pallet_ethereum::Receipt>> {513 Ethereum::current_receipts()514 }515516 fn current_all() -> (517 Option<pallet_ethereum::Block>,518 Option<Vec<pallet_ethereum::Receipt>>,519 Option<Vec<TransactionStatus>>520 ) {521 (522 Ethereum::current_block(),523 Ethereum::current_receipts(),524 Ethereum::current_transaction_statuses()525 )526 }527528 fn extrinsic_filter(xts: Vec<<Block as sp_api::BlockT>::Extrinsic>) -> Vec<pallet_ethereum::Transaction> {529 xts.into_iter().filter_map(|xt| match xt.0.function {530 Call::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction),531 _ => None532 }).collect()533 }534535 fn elasticity() -> Option<Permill> {536 None537 }538 }539540 impl fp_rpc::ConvertTransactionRuntimeApi<Block> for Runtime {541 fn convert_transaction(transaction: pallet_ethereum::Transaction) -> <Block as BlockT>::Extrinsic {542 UncheckedExtrinsic::new_unsigned(543 pallet_ethereum::Call::<Runtime>::transact { transaction }.into(),544 )545 }546 }547548 impl sp_session::SessionKeys<Block> for Runtime {549 fn decode_session_keys(550 encoded: Vec<u8>,551 ) -> Option<Vec<(Vec<u8>, KeyTypeId)>> {552 SessionKeys::decode_into_raw_public_keys(&encoded)553 }554555 fn generate_session_keys(seed: Option<Vec<u8>>) -> Vec<u8> {556 SessionKeys::generate(seed)557 }558 }559560 impl sp_consensus_aura::AuraApi<Block, AuraId> for Runtime {561 fn slot_duration() -> sp_consensus_aura::SlotDuration {562 sp_consensus_aura::SlotDuration::from_millis(Aura::slot_duration())563 }564565 fn authorities() -> Vec<AuraId> {566 Aura::authorities().to_vec()567 }568 }569570 impl cumulus_primitives_core::CollectCollationInfo<Block> for Runtime {571 fn collect_collation_info(header: &<Block as BlockT>::Header) -> cumulus_primitives_core::CollationInfo {572 ParachainSystem::collect_collation_info(header)573 }574 }575576 impl frame_system_rpc_runtime_api::AccountNonceApi<Block, AccountId, Index> for Runtime {577 fn account_nonce(account: AccountId) -> Index {578 System::account_nonce(account)579 }580 }581582 impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi<Block, Balance> for Runtime {583 fn query_info(uxt: <Block as BlockT>::Extrinsic, len: u32) -> RuntimeDispatchInfo<Balance> {584 TransactionPayment::query_info(uxt, len)585 }586 fn query_fee_details(uxt: <Block as BlockT>::Extrinsic, len: u32) -> FeeDetails<Balance> {587 TransactionPayment::query_fee_details(uxt, len)588 }589 }590591 592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632 #[cfg(feature = "runtime-benchmarks")]633 impl frame_benchmarking::Benchmark<Block> for Runtime {634 fn benchmark_metadata(extra: bool) -> (635 Vec<frame_benchmarking::BenchmarkList>,636 Vec<frame_support::traits::StorageInfo>,637 ) {638 use frame_benchmarking::{list_benchmark, Benchmarking, BenchmarkList};639 use frame_support::traits::StorageInfoTrait;640641 let mut list = Vec::<BenchmarkList>::new();642643 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);644 list_benchmark!(list, extra, pallet_common, Common);645 list_benchmark!(list, extra, pallet_unique, Unique);646 list_benchmark!(list, extra, pallet_structure, Structure);647 list_benchmark!(list, extra, pallet_inflation, Inflation);648 list_benchmark!(list, extra, pallet_fungible, Fungible);649 list_benchmark!(list, extra, pallet_refungible, Refungible);650 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);651 list_benchmark!(list, extra, pallet_unique_scheduler, Scheduler);652653 #[cfg(not(feature = "unique-runtime"))]654 list_benchmark!(list, extra, pallet_proxy_rmrk_core, RmrkCore);655656 #[cfg(not(feature = "unique-runtime"))]657 list_benchmark!(list, extra, pallet_proxy_rmrk_equip, RmrkEquip);658659 660661 let storage_info = AllPalletsReversedWithSystemFirst::storage_info();662663 return (list, storage_info)664 }665666 fn dispatch_benchmark(667 config: frame_benchmarking::BenchmarkConfig668 ) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, sp_runtime::RuntimeString> {669 use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark, TrackedStorageKey};670671 let allowlist: Vec<TrackedStorageKey> = vec![672 673 hex_literal::hex!("c2261276cc9d1f8598ea4b6a74b15c2f57c875e4cff74148e4628f264b974c80").to_vec().into(),674675 676 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(),677 678 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(),679 680 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(),681 682 hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(),683684 685 hex_literal::hex!("1da53b775b270400e7e61ed5cbc5a146547f210cec367e9af919603343b9cb56").to_vec().into(),686687 688 hex_literal::hex!("3a7472616e73616374696f6e5f6c6576656c3a").to_vec().into(),689 ];690691 let mut batches = Vec::<BenchmarkBatch>::new();692 let params = (&config, &allowlist);693694 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);695 add_benchmark!(params, batches, pallet_common, Common);696 add_benchmark!(params, batches, pallet_unique, Unique);697 add_benchmark!(params, batches, pallet_structure, Structure);698 add_benchmark!(params, batches, pallet_inflation, Inflation);699 add_benchmark!(params, batches, pallet_fungible, Fungible);700 add_benchmark!(params, batches, pallet_refungible, Refungible);701 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);702 add_benchmark!(params, batches, pallet_unique_scheduler, Scheduler);703704 #[cfg(not(feature = "unique-runtime"))]705 add_benchmark!(params, batches, pallet_proxy_rmrk_core, RmrkCore);706707 #[cfg(not(feature = "unique-runtime"))]708 add_benchmark!(params, batches, pallet_proxy_rmrk_equip, RmrkEquip);709710 711712 if batches.is_empty() { return Err("Benchmark not found for this pallet.".into()) }713 Ok(batches)714 }715 }716717 #[cfg(feature = "try-runtime")]718 impl frame_try_runtime::TryRuntime<Block> for Runtime {719 fn on_runtime_upgrade() -> (Weight, Weight) {720 log::info!("try-runtime::on_runtime_upgrade unique-chain.");721 let weight = Executive::try_runtime_upgrade().unwrap();722 (weight, RuntimeBlockWeights::get().max_block)723 }724725 fn execute_block_no_check(block: Block) -> Weight {726 Executive::execute_block_no_check(block)727 }728 }729 }730 }731}