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
498 select_chain,498 select_chain,
499 };499 };
500500
501 create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_handle, full_deps)?;501 create_full::<_, _, _, Runtime, _>(&mut rpc_handle, full_deps)?;
502502
503 let eth_deps = EthDeps {503 let eth_deps = EthDeps {
504 client,504 client,
547 config: parachain_config,547 config: parachain_config,
548 keystore: params.keystore_container.keystore(),548 keystore: params.keystore_container.keystore(),
549 backend: backend.clone(),549 backend: backend.clone(),
550 network: network.clone(),550 network,
551 sync_service: sync_service.clone(),551 sync_service: sync_service.clone(),
552 system_rpc_tx,552 system_rpc_tx,
553 telemetry: telemetry.as_mut(),553 telemetry: telemetry.as_mut(),
600 if validator {600 if validator {
601 start_consensus(601 start_consensus(
602 client.clone(),602 client.clone(),
603 transaction_pool,
604 StartConsensusParameters {
603 backend.clone(),605 backend: backend.clone(),
604 prometheus_registry.as_ref(),606 prometheus_registry: prometheus_registry.as_ref(),
605 telemetry.as_ref().map(|t| t.handle()),607 telemetry: telemetry.as_ref().map(|t| t.handle()),
606 &task_manager,608 task_manager: &task_manager,
607 relay_chain_interface.clone(),609 relay_chain_interface: relay_chain_interface.clone(),
608 transaction_pool,
609 sync_service.clone(),610 sync_oracle: sync_service,
610 params.keystore_container.keystore(),611 keystore: params.keystore_container.keystore(),
611 overseer_handle,612 overseer_handle,
612 relay_chain_slot_duration,613 relay_chain_slot_duration,
613 para_id,614 para_id,
614 collator_key.expect("cli args do not allow this"),615 collator_key: collator_key.expect("cli args do not allow this"),
615 announce_block,616 announce_block,
617 }
616 )?;618 )?;
617 }619 }
618620
670 .map_err(Into::into)672 .map_err(Into::into)
671}673}
672674
673pub fn start_consensus<ExecutorDispatch, RuntimeApi, Runtime>(675pub struct StartConsensusParameters<'a> {
674 client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
675 backend: Arc<FullBackend>,676 backend: Arc<FullBackend>,
676 prometheus_registry: Option<&Registry>,677 prometheus_registry: Option<&'a Registry>,
677 telemetry: Option<TelemetryHandle>,678 telemetry: Option<TelemetryHandle>,
678 task_manager: &TaskManager,679 task_manager: &'a TaskManager,
679 relay_chain_interface: Arc<dyn RelayChainInterface>,680 relay_chain_interface: Arc<dyn RelayChainInterface>,
680 transaction_pool: Arc<
681 sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
682 >,
683 sync_oracle: Arc<SyncingService<Block>>,681 sync_oracle: Arc<SyncingService<Block>>,
684 keystore: KeystorePtr,682 keystore: KeystorePtr,
685 overseer_handle: OverseerHandle,683 overseer_handle: OverseerHandle,
686 relay_chain_slot_duration: Duration,684 relay_chain_slot_duration: Duration,
687 para_id: ParaId,685 para_id: ParaId,
688 collator_key: CollatorPair,686 collator_key: CollatorPair,
689 announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>,687 announce_block: Arc<dyn Fn(Hash, Option<Vec<u8>>) + Send + Sync>,
688}
689
690pub fn start_consensus<ExecutorDispatch, RuntimeApi, Runtime>(
691 client: Arc<FullClient<RuntimeApi, ExecutorDispatch>>,
692 transaction_pool: Arc<
693 sc_transaction_pool::FullPool<Block, FullClient<RuntimeApi, ExecutorDispatch>>,
694 >,
695 parameters: StartConsensusParameters<'_>,
690) -> Result<(), sc_service::Error>696) -> Result<(), sc_service::Error>
691where697where
692 ExecutorDispatch: NativeExecutionDispatch + 'static,698 ExecutorDispatch: NativeExecutionDispatch + 'static,
693 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>699 RuntimeApi: sp_api::ConstructRuntimeApi<Block, FullClient<RuntimeApi, ExecutorDispatch>>
697 RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,703 RuntimeApi::RuntimeApi: RuntimeApiDep<Runtime> + 'static,
698 Runtime: RuntimeInstance,704 Runtime: RuntimeInstance,
699{705{
706 let StartConsensusParameters {
707 backend,
708 prometheus_registry,
709 telemetry,
710 task_manager,
711 relay_chain_interface,
712 sync_oracle,
713 keystore,
714 overseer_handle,
715 relay_chain_slot_duration,
716 para_id,
717 collator_key,
718 announce_block,
719 } = parameters;
700 let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;720 let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?;
701721
702 let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(722 let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording(
703 task_manager.spawn_handle(),723 task_manager.spawn_handle(),
704 client.clone(),724 client.clone(),
705 transaction_pool,725 transaction_pool,
706 prometheus_registry,726 prometheus_registry,
707 telemetry.clone(),727 telemetry,
708 );728 );
709 let proposer = Proposer::new(proposer_factory);729 let proposer = Proposer::new(proposer_factory);
710730
1043 select_chain,1063 select_chain,
1044 };1064 };
10451065
1046 create_full::<_, _, _, Runtime, RuntimeApi, _>(&mut rpc_module, full_deps)?;1066 create_full::<_, _, _, Runtime, _>(&mut rpc_module, full_deps)?;
10471067
1048 let eth_deps = EthDeps {1068 let eth_deps = EthDeps {
1049 client,1069 client,
modifiedpallets/app-promotion/src/benchmarking.rsdiffbeforeafterboth
--- a/pallets/app-promotion/src/benchmarking.rs
+++ b/pallets/app-promotion/src/benchmarking.rs
@@ -161,7 +161,7 @@
 		T::RelayBlockNumberProvider::set_block_number(30_000.into());
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(pallet_admin.clone()), Some(b as u8));
+		_(RawOrigin::Signed(pallet_admin), Some(b as u8));
 
 		Ok(())
 	}
@@ -178,7 +178,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			share * <T as Config>::Currency::total_balance(&caller),
 		);
 
@@ -211,7 +211,7 @@
 			.collect::<Result<Vec<_>, _>>()?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(caller.clone()));
+		_(RawOrigin::Signed(caller));
 
 		Ok(())
 	}
@@ -242,7 +242,7 @@
 
 		#[extrinsic_call]
 		_(
-			RawOrigin::Signed(caller.clone()),
+			RawOrigin::Signed(caller),
 			Into::<BalanceOf<T>>::into(1000u128) * T::Nominal::get(),
 		);
 
@@ -268,7 +268,7 @@
 		let collection = create_nft_collection::<T>(caller)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(pallet_admin.clone()), collection);
+		_(RawOrigin::Signed(pallet_admin), collection);
 
 		Ok(())
 	}
@@ -296,7 +296,7 @@
 		)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(pallet_admin.clone()), collection);
+		_(RawOrigin::Signed(pallet_admin), collection);
 
 		Ok(())
 	}
@@ -319,7 +319,7 @@
 		<EvmMigrationPallet<T>>::finish(RawOrigin::Root.into(), address, data)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(pallet_admin.clone()), address);
+		_(RawOrigin::Signed(pallet_admin), address);
 
 		Ok(())
 	}
@@ -346,7 +346,7 @@
 		)?;
 
 		#[extrinsic_call]
-		_(RawOrigin::Signed(pallet_admin.clone()), address);
+		_(RawOrigin::Signed(pallet_admin), address);
 
 		Ok(())
 	}
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 }