difftreelog
fix clippy warnings
in: master
12 files changed
Cargo.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",
node/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
node/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;
node/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,
node/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,
pallets/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(())
}
pallets/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(())
pallets/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(())
pallets/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(())
}
runtime/common/config/xcm/foreignassets.rsdiffbeforeafterboth77 let here_id =77 let here_id =78 ConvertAssetId::convert(&AssetId::NativeAssetId(NativeCurrency::Here)).unwrap();78 ConvertAssetId::convert(&AssetId::NativeAssetId(NativeCurrency::Here)).unwrap();797980 if asset_id.clone() == parent_id {80 if *asset_id == parent_id {81 return Some(MultiLocation::parent());81 return Some(MultiLocation::parent());82 }82 }838384 if asset_id.clone() == here_id {84 if *asset_id == here_id {85 return Some(MultiLocation::new(85 return Some(MultiLocation::new(86 1,86 1,87 X1(Parachain(ParachainInfo::get().into())),87 X1(Parachain(ParachainInfo::get().into())),88 ));88 ));89 }89 }909091 let fid =91 let fid = <AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(*asset_id)?;92 <AssetId as TryAsForeign<AssetId, ForeignAssetId>>::try_as_foreign(asset_id.clone())?;93 XcmForeignAssetIdMapping::<Runtime>::get_multi_location(fid)92 XcmForeignAssetIdMapping::<Runtime>::get_multi_location(fid)94 }93 }95}94}runtime/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 }
runtime/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 }