git.delta.rocks / unique-network / refs/commits / 3db37f4ef63b

difftreelog

fix clippy warnings

Grigoriy Simonov2023-10-12parent: #5f71c37.patch.diff
in: master

12 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -10145,6 +10145,7 @@
  "sp-runtime",
  "sp-session",
  "sp-std",
+ "sp-storage",
  "sp-transaction-pool",
  "sp-version",
  "staging-xcm",
@@ -14897,6 +14898,7 @@
  "sp-runtime",
  "sp-session",
  "sp-std",
+ "sp-storage",
  "sp-transaction-pool",
  "sp-version",
  "staging-xcm",
modifiednode/cli/src/chain_spec.rsdiffbeforeafterboth
--- a/node/cli/src/chain_spec.rs
+++ b/node/cli/src/chain_spec.rs
@@ -238,7 +238,7 @@
 			vesting: VestingConfig { vesting: vec![] },
 			parachain_info: ParachainInfoConfig {
 				parachain_id: $id.into(),
-				Default::default()
+				..Default::default()
 			},
 			aura: AuraConfig {
 				authorities: $initial_invulnerables
modifiednode/cli/src/command.rsdiffbeforeafterboth
--- a/node/cli/src/command.rs
+++ b/node/cli/src/command.rs
@@ -399,6 +399,7 @@
 		Some(Subcommand::TryRuntime(cmd)) => {
 			use std::{future::Future, pin::Pin};
 
+			use polkadot_cli::Block;
 			use sc_executor::{sp_wasm_interface::ExtendedHostFunctions, NativeExecutionDispatch};
 			use try_runtime_cli::block_building_info::timestamp_with_aura_info;
 
modifiednode/cli/src/rpc.rsdiffbeforeafterboth
--- a/node/cli/src/rpc.rs
+++ b/node/cli/src/rpc.rs
@@ -67,7 +67,7 @@
 }
 
 /// Instantiate all Full RPC extensions.
-pub fn create_full<C, P, SC, R, A, B>(
+pub fn create_full<C, P, SC, R, B>(
 	io: &mut RpcModule<()>,
 	deps: FullDeps<C, P, SC>,
 ) -> Result<(), Box<dyn std::error::Error + Send + Sync>>
@@ -244,7 +244,7 @@
 			EthFilter::new(
 				client.clone(),
 				eth_backend,
-				graph.clone(),
+				graph,
 				filter_pool,
 				500_usize, // max stored filters
 				max_past_logs,
modifiednode/cli/src/service.rsdiffbeforeafterboth
--- a/node/cli/src/service.rs
+++ b/node/cli/src/service.rs
@@ -498,7 +498,7 @@
 				select_chain,
 			};
 
-			create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_handle, full_deps)?;
+			create_full::<_, _, _, Runtime, _>(&mut rpc_handle, full_deps)?;
 
 			let eth_deps = EthDeps {
 				client,
@@ -547,7 +547,7 @@
 		config: parachain_config,
 		keystore: params.keystore_container.keystore(),
 		backend: backend.clone(),
-		network: network.clone(),
+		network,
 		sync_service: sync_service.clone(),
 		system_rpc_tx,
 		telemetry: telemetry.as_mut(),
@@ -600,19 +600,21 @@
 	if validator {
 		start_consensus(
 			client.clone(),
-			backend.clone(),
-			prometheus_registry.as_ref(),
-			telemetry.as_ref().map(|t| t.handle()),
-			&task_manager,
-			relay_chain_interface.clone(),
 			transaction_pool,
-			sync_service.clone(),
-			params.keystore_container.keystore(),
-			overseer_handle,
-			relay_chain_slot_duration,
-			para_id,
-			collator_key.expect("cli args do not allow this"),
-			announce_block,
+			StartConsensusParameters {
+				backend: backend.clone(),
+				prometheus_registry: prometheus_registry.as_ref(),
+				telemetry: telemetry.as_ref().map(|t| t.handle()),
+				task_manager: &task_manager,
+				relay_chain_interface: relay_chain_interface.clone(),
+				sync_oracle: sync_service,
+				keystore: params.keystore_container.keystore(),
+				overseer_handle,
+				relay_chain_slot_duration,
+				para_id,
+				collator_key: collator_key.expect("cli args do not allow this"),
+				announce_block,
+			}
 		)?;
 	}
 
@@ -670,16 +672,12 @@
 	.map_err(Into::into)
 }
 
-pub fn start_consensus<ExecutorDispatch, RuntimeApi, Runtime>(
-	client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+pub struct StartConsensusParameters<'a> {
 	backend: Arc<FullBackend>,
-	prometheus_registry: Option<&Registry>,
+	prometheus_registry: Option<&'a Registry>,
 	telemetry: Option<TelemetryHandle>,
-	task_manager: &TaskManager,
+	task_manager: &'a TaskManager,
 	relay_chain_interface: Arc<dyn RelayChainInterface>,
-	transaction_pool: Arc<
-		sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
-	>,
 	sync_oracle: Arc<SyncingService<Block>>,
 	keystore: KeystorePtr,
 	overseer_handle: OverseerHandle,
@@ -687,6 +685,14 @@
 	para_id: ParaId,
 	collator_key: CollatorPair,
 	announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>,
+}
+
+pub fn start_consensus<ExecutorDispatch, RuntimeApi, Runtime>(
+	client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
+	transaction_pool: Arc<
+		sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
+	>,
+	parameters: StartConsensusParameters<'_>,
 ) -> Result<(), sc_service::Error>
 where
 	ExecutorDispatch: NativeExecutionDispatch + 'static,
@@ -697,6 +703,20 @@
 	RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,
 	Runtime: RuntimeInstance,
 {
+	let StartConsensusParameters {
+		backend,
+		prometheus_registry,
+		telemetry,
+		task_manager,
+		relay_chain_interface,
+		sync_oracle,
+		keystore,
+		overseer_handle,
+		relay_chain_slot_duration,
+		para_id,
+		collator_key,
+		announce_block,
+	} = parameters;
 	let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
 
 	let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
@@ -704,7 +724,7 @@
 		client.clone(),
 		transaction_pool,
 		prometheus_registry,
-		telemetry.clone(),
+		telemetry,
 	);
 	let proposer = Proposer::new(proposer_factory);
 
@@ -1043,7 +1063,7 @@
 				select_chain,
 			};
 
-			create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_module, full_deps)?;
+			create_full::<_, _, _, Runtime, _>(&mut rpc_module, full_deps)?;
 
 			let eth_deps = EthDeps {
 				client,
modifiedpallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth
after · pallets/app-promotion/src/benchmarking.rs
1// Copyright 2019-2022 Unique Network (Gibraltar) Ltd.2// This file is part of Unique Network.34// Unique Network is free software: you can redistribute it and/or modify5// it under the terms of the GNU General Public License as published by6// the Free Software Foundation, either version 3 of the License, or7// (at your option) any later version.89// Unique Network is distributed in the hope that it will be useful,10// but WITHOUT ANY WARRANTY; without even the implied warranty of11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the12// GNU General Public License for more details.1314// You should have received a copy of the GNU General Public License15// along with Unique Network. If not, see <http://www.gnu.org/licenses/>.1617#![cfg(feature = "runtime-benchmarks")]1819use frame_benchmarking::v2::*;20use frame_support::traits::{21	fungible::{Inspect, Mutate, Unbalanced},22	OnInitialize,23};24use frame_system::{pallet_prelude::*, RawOrigin};25use pallet_evm::account::CrossAccountId;26use pallet_evm_migration::Pallet as EvmMigrationPallet;27use pallet_unique::benchmarking::create_nft_collection;28use sp_core::{Get, H160};29use sp_runtime::{30	traits::{BlockNumberProvider, Bounded},31	Perbill,32};33use sp_std::{iter::Sum, vec, vec::Vec};3435use super::{BalanceOf, Call, Config, Pallet, Staked, PENDING_LIMIT_PER_BLOCK};36use crate::{pallet, Pallet as PromototionPallet};3738const SEED: u32 = 0;3940fn set_admin<T>() -> Result<T::AccountId, sp_runtime::DispatchError>41where42	T: Config + pallet_unique::Config + pallet_evm_migration::Config,43	BlockNumberFor<T>: From<u32> + Into<u32>,44	BalanceOf<T>: Sum + From<u128>,45{46	let pallet_admin = account::<T::AccountId>("admin", 0, SEED);4748	<T as Config>::Currency::set_balance(49		&pallet_admin,50		Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),51	);5253	PromototionPallet::<T>::set_admin_address(54		RawOrigin::Root.into(),55		T::CrossAccountId::from_sub(pallet_admin.clone()),56	)?;5758	Ok(pallet_admin)59}6061#[benchmarks(62	where T:  Config + pallet_unique::Config + pallet_evm_migration::Config ,63		BlockNumberFor<T>: From<u32> + Into<u32>,64		BalanceOf<T>: Sum + From<u128>65)]66mod benchmarks {67	use super::*;6869	#[benchmark]70	fn on_initialize(b: Linear<0, PENDING_LIMIT_PER_BLOCK>) -> Result<(), BenchmarkError> {71		set_admin::<T>()?;7273		(0..b).try_for_each(|index| {74			let staker = account::<T::AccountId>("staker", index, SEED);75			<T as Config>::Currency::write_balance(76				&staker,77				Into::<BalanceOf<T>>::into(10_000u128) * T::Nominal::get(),78			)?;79			PromototionPallet::<T>::stake(80				RawOrigin::Signed(staker.clone()).into(),81				Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get(),82			)?;83			PromototionPallet::<T>::unstake_all(RawOrigin::Signed(staker).into())?;84			Result::<(), sp_runtime::DispatchError>::Ok(())85		})?;86		let block_number =87			<frame_system::Pallet<T>>::current_block_number() + T::PendingInterval::get();8889		#[block]90		{91			PromototionPallet::<T>::on_initialize(block_number);92		}9394		Ok(())95	}9697	#[benchmark]98	fn set_admin_address() -> Result<(), BenchmarkError> {99		let pallet_admin = account::<T::AccountId>("admin", 0, SEED);100		let _ = <T as Config>::Currency::set_balance(101			&pallet_admin,102			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),103		);104105		#[extrinsic_call]106		_(RawOrigin::Root, T::CrossAccountId::from_sub(pallet_admin));107108		Ok(())109	}110111	#[benchmark]112	fn payout_stakers(b: Linear<1, 100>) -> Result<(), BenchmarkError> {113		let pallet_admin = account::<T::AccountId>("admin", 1, SEED);114		PromototionPallet::<T>::set_admin_address(115			RawOrigin::Root.into(),116			T::CrossAccountId::from_sub(pallet_admin.clone()),117		)?;118		<T as Config>::Currency::write_balance(119			&pallet_admin,120			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),121		)?;122		<T as Config>::Currency::write_balance(123			&<T as pallet::Config>::TreasuryAccountId::get(),124			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),125		)?;126127		let stakers: Vec<T::AccountId> =128			(0..b).map(|index| account("staker", index, SEED)).collect();129		stakers.iter().try_for_each(|staker| {130			<T as Config>::Currency::write_balance(131				staker,132				Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),133			)?;134			Result::<(), sp_runtime::DispatchError>::Ok(())135		})?;136		(1..11).try_for_each(|i| {137			<frame_system::Pallet<T>>::set_block_number(i.into());138			T::RelayBlockNumberProvider::set_block_number((2 * i).into());139			assert_eq!(<frame_system::Pallet<T>>::block_number(), i.into());140			assert_eq!(141				T::RelayBlockNumberProvider::current_block_number(),142				(2 * i).into()143			);144			stakers145				.iter()146				.map(|staker| {147					PromototionPallet::<T>::stake(148						RawOrigin::Signed(staker.clone()).into(),149						Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get(),150					)151				})152				.collect::<Result<Vec<_>, _>>()?;153154			Result::<(), sp_runtime::DispatchError>::Ok(())155		})?;156157		let stakes = Staked::<T>::iter_prefix((&stakers[0],)).collect::<Vec<_>>();158		assert_eq!(stakes.len(), 10);159160		<frame_system::Pallet<T>>::set_block_number(15_000.into());161		T::RelayBlockNumberProvider::set_block_number(30_000.into());162163		#[extrinsic_call]164		_(RawOrigin::Signed(pallet_admin), Some(b as u8));165166		Ok(())167	}168169	#[benchmark]170	fn stake() -> Result<(), BenchmarkError> {171		let caller = account::<T::AccountId>("caller", 0, SEED);172		let share = Perbill::from_rational(1u32, 10);173174		let _ = <T as Config>::Currency::write_balance(175			&caller,176			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),177		);178179		#[extrinsic_call]180		_(181			RawOrigin::Signed(caller),182			share * <T as Config>::Currency::total_balance(&caller),183		);184185		Ok(())186	}187188	#[benchmark]189	fn unstake_all() -> Result<(), BenchmarkError> {190		let caller = account::<T::AccountId>("caller", 0, SEED);191		let share = Perbill::from_rational(1u32, 20);192		let _ = <T as Config>::Currency::write_balance(193			&caller,194			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),195		);196		(1..11)197			.map(|i| {198				// used to change block number199				<frame_system::Pallet<T>>::set_block_number(i.into());200				T::RelayBlockNumberProvider::set_block_number((2 * i).into());201				assert_eq!(<frame_system::Pallet<T>>::block_number(), i.into());202				assert_eq!(203					T::RelayBlockNumberProvider::current_block_number(),204					(2 * i).into()205				);206				PromototionPallet::<T>::stake(207					RawOrigin::Signed(caller.clone()).into(),208					share * <T as Config>::Currency::total_balance(&caller),209				)210			})211			.collect::<Result<Vec<_>, _>>()?;212213		#[extrinsic_call]214		_(RawOrigin::Signed(caller));215216		Ok(())217	}218219	#[benchmark]220	fn unstake_partial() -> Result<(), BenchmarkError> {221		let caller = account::<T::AccountId>("caller", 0, SEED);222		let _ = <T as Config>::Currency::write_balance(223			&caller,224			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),225		);226		(1..11)227			.map(|i| {228				// used to change block number229				<frame_system::Pallet<T>>::set_block_number(i.into());230				T::RelayBlockNumberProvider::set_block_number((2 * i).into());231				assert_eq!(<frame_system::Pallet<T>>::block_number(), i.into());232				assert_eq!(233					T::RelayBlockNumberProvider::current_block_number(),234					(2 * i).into()235				);236				PromototionPallet::<T>::stake(237					RawOrigin::Signed(caller.clone()).into(),238					Into::<BalanceOf<T>>::into(100u128) * T::Nominal::get(),239				)240			})241			.collect::<Result<Vec<_>, _>>()?;242243		#[extrinsic_call]244		_(245			RawOrigin::Signed(caller),246			Into::<BalanceOf<T>>::into(1000u128) * T::Nominal::get(),247		);248249		Ok(())250	}251252	#[benchmark]253	fn sponsor_collection() -> Result<(), BenchmarkError> {254		let pallet_admin = account::<T::AccountId>("admin", 0, SEED);255		PromototionPallet::<T>::set_admin_address(256			RawOrigin::Root.into(),257			T::CrossAccountId::from_sub(pallet_admin.clone()),258		)?;259		let _ = <T as Config>::Currency::write_balance(260			&pallet_admin,261			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),262		);263		let caller: T::AccountId = account("caller", 0, SEED);264		let _ = <T as Config>::Currency::write_balance(265			&caller,266			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),267		);268		let collection = create_nft_collection::<T>(caller)?;269270		#[extrinsic_call]271		_(RawOrigin::Signed(pallet_admin), collection);272273		Ok(())274	}275276	#[benchmark]277	fn stop_sponsoring_collection() -> Result<(), BenchmarkError> {278		let pallet_admin = account::<T::AccountId>("admin", 0, SEED);279		PromototionPallet::<T>::set_admin_address(280			RawOrigin::Root.into(),281			T::CrossAccountId::from_sub(pallet_admin.clone()),282		)?;283		let _ = <T as Config>::Currency::write_balance(284			&pallet_admin,285			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),286		);287		let caller: T::AccountId = account("caller", 0, SEED);288		let _ = <T as Config>::Currency::write_balance(289			&caller,290			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),291		);292		let collection = create_nft_collection::<T>(caller)?;293		PromototionPallet::<T>::sponsor_collection(294			RawOrigin::Signed(pallet_admin.clone()).into(),295			collection,296		)?;297298		#[extrinsic_call]299		_(RawOrigin::Signed(pallet_admin), collection);300301		Ok(())302	}303304	#[benchmark]305	fn sponsor_contract() -> Result<(), BenchmarkError> {306		let pallet_admin = account::<T::AccountId>("admin", 0, SEED);307		PromototionPallet::<T>::set_admin_address(308			RawOrigin::Root.into(),309			T::CrossAccountId::from_sub(pallet_admin.clone()),310		)?;311312		let _ = <T as Config>::Currency::write_balance(313			&pallet_admin,314			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),315		);316		let address = H160::from_low_u64_be(SEED as u64);317		let data: Vec<u8> = (0..20).collect();318		<EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;319		<EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;320321		#[extrinsic_call]322		_(RawOrigin::Signed(pallet_admin), address);323324		Ok(())325	}326327	#[benchmark]328	fn stop_sponsoring_contract() -> Result<(), BenchmarkError> {329		let pallet_admin = account::<T::AccountId>("admin", 0, SEED);330		PromototionPallet::<T>::set_admin_address(331			RawOrigin::Root.into(),332			T::CrossAccountId::from_sub(pallet_admin.clone()),333		)?;334335		let _ = <T as Config>::Currency::write_balance(336			&pallet_admin,337			Perbill::from_rational(1u32, 2) * BalanceOf::<T>::max_value(),338		);339		let address = H160::from_low_u64_be(SEED as u64);340		let data: Vec<u8> = (0..20).collect();341		<EvmMigrationPallet<T>>::begin(RawOrigin::Root.into(), address)?;342		<EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;343		PromototionPallet::<T>::sponsor_contract(344			RawOrigin::Signed(pallet_admin.clone()).into(),345			address,346		)?;347348		#[extrinsic_call]349		_(RawOrigin::Signed(pallet_admin), address);350351		Ok(())352	}353}
modifiedpallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/benchmarking.rs
+++ b/pallets/nonfungible/src/benchmarking.rs
@@ -75,7 +75,7 @@
 
 		#[block]
 		{
-			create_max_item(&collection, &sender, to.clone())?;
+			create_max_item(&collection, &sender, to)?;
 		}
 
 		Ok(())
modifiedpallets/refungible/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/refungible/src/benchmarking.rs
+++ b/pallets/refungible/src/benchmarking.rs
@@ -82,7 +82,7 @@
 
 		#[block]
 		{
-			create_max_item(&collection, &sender, [(to.clone(), 200)])?;
+			create_max_item(&collection, &sender, [(to, 200)])?;
 		}
 
 		Ok(())
modifiedpallets/unique/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/unique/src/benchmarking.rs
+++ b/pallets/unique/src/benchmarking.rs
@@ -107,7 +107,7 @@
 		let collection = create_nft_collection::<T>(caller.clone())?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()), collection);
+		_(RawOrigin::Signed(caller), collection);
 
 		Ok(())
 	}
@@ -120,7 +120,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			collection,
 			T::CrossAccountId::from_sub(allowlist_account),
 		);
@@ -141,7 +141,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			collection,
 			T::CrossAccountId::from_sub(allowlist_account),
 		);
@@ -156,7 +156,7 @@
 		let new_owner: T::AccountId = account("admin", 0, SEED);
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()), collection, new_owner);
+		_(RawOrigin::Signed(caller), collection, new_owner);
 
 		Ok(())
 	}
@@ -169,7 +169,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			collection,
 			T::CrossAccountId::from_sub(new_admin),
 		);
@@ -190,7 +190,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			collection,
 			T::CrossAccountId::from_sub(new_admin),
 		);
@@ -204,11 +204,7 @@
 		let collection = create_nft_collection::<T>(caller.clone())?;
 
 		#[extrinsic_call]
-		_(
-			RawOrigin::Signed(caller.clone()),
-			collection,
-			caller.clone(),
-		);
+		_(RawOrigin::Signed(caller), collection, caller.clone());
 
 		Ok(())
 	}
@@ -224,7 +220,7 @@
 		)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()), collection);
+		_(RawOrigin::Signed(caller), collection);
 
 		Ok(())
 	}
@@ -241,7 +237,7 @@
 		<Pallet<T>>::confirm_sponsorship(RawOrigin::Signed(caller.clone()).into(), collection)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()), collection);
+		_(RawOrigin::Signed(caller), collection);
 
 		Ok(())
 	}
@@ -252,7 +248,7 @@
 		let collection = create_nft_collection::<T>(caller.clone())?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()), collection, false);
+		_(RawOrigin::Signed(caller), collection, false);
 
 		Ok(())
 	}
@@ -275,7 +271,7 @@
 		};
 
 		#[extrinsic_call]
-		set_collection_limits(RawOrigin::Signed(caller.clone()), collection, cl);
+		set_collection_limits(RawOrigin::Signed(caller), collection, cl);
 
 		Ok(())
 	}
modifiedruntime/common/config/xcm/foreignassets.rsdiffbeforeafterboth
--- a/runtime/common/config/xcm/foreignassets.rs
+++ b/runtime/common/config/xcm/foreignassets.rs
@@ -77,19 +77,18 @@
 		let here_id =
 			ConvertAssetId::convert(&AssetId::NativeAssetId(NativeCurrency::Here)).unwrap();
 
-		if asset_id.clone() == parent_id {
+		if *asset_id == parent_id {
 			return Some(MultiLocation::parent());
 		}
 
-		if asset_id.clone() == here_id {
+		if *asset_id == here_id {
 			return Some(MultiLocation::new(
 				1,
 				X1(Parachain(ParachainInfo::get().into())),
 			));
 		}
 
-		let fid =
-			<AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(asset_id.clone())?;
+		let fid = <AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(*asset_id)?;
 		XcmForeignAssetIdMapping::<Runtime>::get_multi_location(fid)
 	}
 }
modifiedruntime/quartz/Cargo.tomldiffbeforeafterboth
--- a/runtime/quartz/Cargo.toml
+++ b/runtime/quartz/Cargo.toml
@@ -271,6 +271,7 @@
 sp-runtime = { workspace = true }
 sp-session = { workspace = true }
 sp-std = { workspace = true }
+sp-storage = { workspace = true }
 sp-transaction-pool = { workspace = true }
 sp-version = { workspace = true }
 staging-xcm = { workspace = true }
modifiedruntime/unique/Cargo.tomldiffbeforeafterboth
--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -274,6 +274,7 @@
 sp-runtime = { workspace = true }
 sp-session = { workspace = true }
 sp-std = { workspace = true }
+sp-storage = { workspace = true }
 sp-transaction-pool = { workspace = true }
 sp-version = { workspace = true }
 staging-xcm = { workspace = true }