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.rsdiffbeforeafterboth1// 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/>.1617use std::sync::Arc;1819use fc_mapping_sync::{EthereumBlockNotification, EthereumBlockNotificationSinks};20use fc_rpc::{21 pending::AuraConsensusDataProvider, EthBlockDataCacheTask, EthConfig, OverrideHandle,22};23use fc_rpc_core::types::{FeeHistoryCache, FilterPool};24use fp_rpc::NoTransactionConverter;25use jsonrpsee::RpcModule;26use sc_client_api::{27 backend::{AuxStore, StorageProvider},28 client::BlockchainEvents,29 UsageProvider,30};31use sc_network::NetworkService;32use sc_network_sync::SyncingService;33use sc_rpc::SubscriptionTaskExecutor;34pub use sc_rpc_api::DenyUnsafe;35use sc_service::TransactionPool;36use sc_transaction_pool::{ChainApi, Pool};37use sp_api::ProvideRuntimeApi;38use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};39use sp_inherents::CreateInherentDataProviders;40use sp_runtime::traits::BlakeTwo256;41use up_common::types::opaque::*;4243use crate::service::RuntimeApiDep;4445#[cfg(feature = "pov-estimate")]46type FullBackend = sc_service::TFullBackend<Block>;4748/// Full client dependencies.49pub struct FullDeps<C, P, SC> {50 /// The client instance to use.51 pub client: Arc<C>,52 /// Transaction pool instance.53 pub pool: Arc<P>,54 /// The SelectChain Strategy55 pub select_chain: SC,56 /// Whether to deny unsafe calls57 pub deny_unsafe: DenyUnsafe,5859 /// Runtime identification (read from the chain spec)60 pub runtime_id: RuntimeId,61 /// Executor params for PoV estimating62 #[cfg(feature = "pov-estimate")]63 pub exec_params: uc_rpc::pov_estimate::ExecutorParams,64 /// Substrate Backend.65 #[cfg(feature = "pov-estimate")]66 pub backend: Arc<FullBackend>,67}6869/// Instantiate all Full RPC extensions.70pub fn create_full<C, P, SC, R, A, B>(71 io: &mut RpcModule<()>,72 deps: FullDeps<C, P, SC>,73) -> Result<(), Box<dyn std::error::Error + Send + Sync>>74where75 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,76 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,77 C: Send + Sync + 'static,78 C: BlockchainEvents<Block>,79 C::Api: RuntimeApiDep<R>,80 B: sc_client_api::Backend<Block> + Send + Sync + 'static,81 P: TransactionPool<Block = Block> + 'static,82 R: RuntimeInstance + Send + Sync + 'static,83 <R as RuntimeInstance>::CrossAccountId: serde::Serialize,84 C: sp_api::CallApiAt<85 sp_runtime::generic::Block<86 sp_runtime::generic::Header<u32, BlakeTwo256>,87 sp_runtime::OpaqueExtrinsic,88 >,89 >,90 for<'de> <R as RuntimeInstance>::CrossAccountId: serde::Deserialize<'de>,91{92 // use pallet_contracts_rpc::{Contracts, ContractsApi};93 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};94 use substrate_frame_rpc_system::{System, SystemApiServer};95 #[cfg(feature = "pov-estimate")]96 use uc_rpc::pov_estimate::{PovEstimate, PovEstimateApiServer};97 use uc_rpc::{AppPromotion, AppPromotionApiServer, Unique, UniqueApiServer};9899 let FullDeps {100 client,101 pool,102 select_chain: _,103 deny_unsafe,104105 runtime_id: _,106107 #[cfg(feature = "pov-estimate")]108 exec_params,109110 #[cfg(feature = "pov-estimate")]111 backend,112 } = deps;113114 io.merge(System::new(Arc::clone(&client), Arc::clone(&pool), deny_unsafe).into_rpc())?;115 io.merge(TransactionPayment::new(Arc::clone(&client)).into_rpc())?;116117 io.merge(Unique::new(client.clone()).into_rpc())?;118119 io.merge(AppPromotion::new(client).into_rpc())?;120121 #[cfg(feature = "pov-estimate")]122 io.merge(123 PovEstimate::new(124 client.clone(),125 backend,126 deny_unsafe,127 exec_params,128 runtime_id,129 )130 .into_rpc(),131 )?;132133 Ok(())134}135136pub struct EthDeps<C, P, CA: ChainApi, CIDP> {137 /// The client instance to use.138 pub client: Arc<C>,139 /// Transaction pool instance.140 pub pool: Arc<P>,141 /// Graph pool instance.142 pub graph: Arc<Pool<CA>>,143 /// Syncing service144 pub sync: Arc<SyncingService<Block>>,145 /// The Node authority flag146 pub is_authority: bool,147 /// Network service148 pub network: Arc<NetworkService<Block, Hash>>,149150 /// Ethereum Backend.151 pub eth_backend: Arc<dyn fc_api::Backend<Block> + Send + Sync>,152 /// Maximum number of logs in a query.153 pub max_past_logs: u32,154 /// Maximum fee history cache size.155 pub fee_history_limit: u64,156 /// Fee history cache.157 pub fee_history_cache: FeeHistoryCache,158 pub eth_block_data_cache: Arc<EthBlockDataCacheTask<Block>>,159 /// EthFilterApi pool.160 pub eth_filter_pool: Option<FilterPool>,161 pub eth_pubsub_notification_sinks:162 Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>>,163 /// Whether to enable eth dev signer164 pub enable_dev_signer: bool,165166 pub overrides: Arc<OverrideHandle<Block>>,167 pub pending_create_inherent_data_providers: CIDP,168}169170pub fn create_eth<C, R, P, CA, B, CIDP, EC>(171 io: &mut RpcModule<()>,172 deps: EthDeps<C, P, CA, CIDP>,173 subscription_task_executor: SubscriptionTaskExecutor,174) -> Result<(), Box<dyn std::error::Error + Send + Sync>>175where176 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,177 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,178 C: Send + Sync + 'static,179 C: BlockchainEvents<Block>,180 C: UsageProvider<Block>,181 C::Api: RuntimeApiDep<R>,182 P: TransactionPool<Block = Block> + 'static,183 CA: ChainApi<Block = Block> + 'static,184 B: sc_client_api::Backend<Block> + Send + Sync + 'static,185 C: sp_api::CallApiAt<Block>,186 CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,187 EC: EthConfig<Block, C>,188 R: RuntimeInstance,189{190 use fc_rpc::{191 Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,192 EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,193 };194195 let EthDeps {196 client,197 pool,198 graph,199 eth_backend,200 max_past_logs,201 fee_history_limit,202 fee_history_cache,203 eth_block_data_cache,204 eth_filter_pool,205 eth_pubsub_notification_sinks,206 enable_dev_signer,207 sync,208 is_authority,209 network,210 overrides,211 pending_create_inherent_data_providers,212 } = deps;213214 let mut signers = Vec::new();215 if enable_dev_signer {216 signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);217 }218 let execute_gas_limit_multiplier = 10;219 io.merge(220 Eth::<_, _, _, _, _, _, _, EC>::new(221 client.clone(),222 pool.clone(),223 graph.clone(),224 // We have no runtimes old enough to only accept converted transactions225 None::<NoTransactionConverter>,226 sync.clone(),227 signers,228 overrides.clone(),229 eth_backend.clone(),230 is_authority,231 eth_block_data_cache.clone(),232 fee_history_cache,233 fee_history_limit,234 execute_gas_limit_multiplier,235 None,236 pending_create_inherent_data_providers,237 Some(Box::new(AuraConsensusDataProvider::new(client.clone()))),238 )239 .into_rpc(),240 )?;241242 if let Some(filter_pool) = eth_filter_pool {243 io.merge(244 EthFilter::new(245 client.clone(),246 eth_backend,247 graph.clone(),248 filter_pool,249 500_usize, // max stored filters250 max_past_logs,251 eth_block_data_cache,252 )253 .into_rpc(),254 )?;255 }256 io.merge(257 Net::new(258 client.clone(),259 network,260 // Whether to format the `peer_count` response as Hex (default) or not.261 true,262 )263 .into_rpc(),264 )?;265 io.merge(Web3::new(client.clone()).into_rpc())?;266 io.merge(267 EthPubSub::new(268 pool,269 client,270 sync,271 subscription_task_executor,272 overrides,273 eth_pubsub_notification_sinks,274 )275 .into_rpc(),276 )?;277278 Ok(())279}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/>.1617use std::sync::Arc;1819use fc_mapping_sync::{EthereumBlockNotification, EthereumBlockNotificationSinks};20use fc_rpc::{21 pending::AuraConsensusDataProvider, EthBlockDataCacheTask, EthConfig, OverrideHandle,22};23use fc_rpc_core::types::{FeeHistoryCache, FilterPool};24use fp_rpc::NoTransactionConverter;25use jsonrpsee::RpcModule;26use sc_client_api::{27 backend::{AuxStore, StorageProvider},28 client::BlockchainEvents,29 UsageProvider,30};31use sc_network::NetworkService;32use sc_network_sync::SyncingService;33use sc_rpc::SubscriptionTaskExecutor;34pub use sc_rpc_api::DenyUnsafe;35use sc_service::TransactionPool;36use sc_transaction_pool::{ChainApi, Pool};37use sp_api::ProvideRuntimeApi;38use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata};39use sp_inherents::CreateInherentDataProviders;40use sp_runtime::traits::BlakeTwo256;41use up_common::types::opaque::*;4243use crate::service::RuntimeApiDep;4445#[cfg(feature = "pov-estimate")]46type FullBackend = sc_service::TFullBackend<Block>;4748/// Full client dependencies.49pub struct FullDeps<C, P, SC> {50 /// The client instance to use.51 pub client: Arc<C>,52 /// Transaction pool instance.53 pub pool: Arc<P>,54 /// The SelectChain Strategy55 pub select_chain: SC,56 /// Whether to deny unsafe calls57 pub deny_unsafe: DenyUnsafe,5859 /// Runtime identification (read from the chain spec)60 pub runtime_id: RuntimeId,61 /// Executor params for PoV estimating62 #[cfg(feature = "pov-estimate")]63 pub exec_params: uc_rpc::pov_estimate::ExecutorParams,64 /// Substrate Backend.65 #[cfg(feature = "pov-estimate")]66 pub backend: Arc<FullBackend>,67}6869/// Instantiate all Full RPC extensions.70pub fn create_full<C, P, SC, R, B>(71 io: &mut RpcModule<()>,72 deps: FullDeps<C, P, SC>,73) -> Result<(), Box<dyn std::error::Error + Send + Sync>>74where75 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,76 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,77 C: Send + Sync + 'static,78 C: BlockchainEvents<Block>,79 C::Api: RuntimeApiDep<R>,80 B: sc_client_api::Backend<Block> + Send + Sync + 'static,81 P: TransactionPool<Block = Block> + 'static,82 R: RuntimeInstance + Send + Sync + 'static,83 <R as RuntimeInstance>::CrossAccountId: serde::Serialize,84 C: sp_api::CallApiAt<85 sp_runtime::generic::Block<86 sp_runtime::generic::Header<u32, BlakeTwo256>,87 sp_runtime::OpaqueExtrinsic,88 >,89 >,90 for<'de> <R as RuntimeInstance>::CrossAccountId: serde::Deserialize<'de>,91{92 // use pallet_contracts_rpc::{Contracts, ContractsApi};93 use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer};94 use substrate_frame_rpc_system::{System, SystemApiServer};95 #[cfg(feature = "pov-estimate")]96 use uc_rpc::pov_estimate::{PovEstimate, PovEstimateApiServer};97 use uc_rpc::{AppPromotion, AppPromotionApiServer, Unique, UniqueApiServer};9899 let FullDeps {100 client,101 pool,102 select_chain: _,103 deny_unsafe,104105 runtime_id: _,106107 #[cfg(feature = "pov-estimate")]108 exec_params,109110 #[cfg(feature = "pov-estimate")]111 backend,112 } = deps;113114 io.merge(System::new(Arc::clone(&client), Arc::clone(&pool), deny_unsafe).into_rpc())?;115 io.merge(TransactionPayment::new(Arc::clone(&client)).into_rpc())?;116117 io.merge(Unique::new(client.clone()).into_rpc())?;118119 io.merge(AppPromotion::new(client).into_rpc())?;120121 #[cfg(feature = "pov-estimate")]122 io.merge(123 PovEstimate::new(124 client.clone(),125 backend,126 deny_unsafe,127 exec_params,128 runtime_id,129 )130 .into_rpc(),131 )?;132133 Ok(())134}135136pub struct EthDeps<C, P, CA: ChainApi, CIDP> {137 /// The client instance to use.138 pub client: Arc<C>,139 /// Transaction pool instance.140 pub pool: Arc<P>,141 /// Graph pool instance.142 pub graph: Arc<Pool<CA>>,143 /// Syncing service144 pub sync: Arc<SyncingService<Block>>,145 /// The Node authority flag146 pub is_authority: bool,147 /// Network service148 pub network: Arc<NetworkService<Block, Hash>>,149150 /// Ethereum Backend.151 pub eth_backend: Arc<dyn fc_api::Backend<Block> + Send + Sync>,152 /// Maximum number of logs in a query.153 pub max_past_logs: u32,154 /// Maximum fee history cache size.155 pub fee_history_limit: u64,156 /// Fee history cache.157 pub fee_history_cache: FeeHistoryCache,158 pub eth_block_data_cache: Arc<EthBlockDataCacheTask<Block>>,159 /// EthFilterApi pool.160 pub eth_filter_pool: Option<FilterPool>,161 pub eth_pubsub_notification_sinks:162 Arc<EthereumBlockNotificationSinks<EthereumBlockNotification<Block>>>,163 /// Whether to enable eth dev signer164 pub enable_dev_signer: bool,165166 pub overrides: Arc<OverrideHandle<Block>>,167 pub pending_create_inherent_data_providers: CIDP,168}169170pub fn create_eth<C, R, P, CA, B, CIDP, EC>(171 io: &mut RpcModule<()>,172 deps: EthDeps<C, P, CA, CIDP>,173 subscription_task_executor: SubscriptionTaskExecutor,174) -> Result<(), Box<dyn std::error::Error + Send + Sync>>175where176 C: ProvideRuntimeApi<Block> + StorageProvider<Block, B> + AuxStore,177 C: HeaderBackend<Block> + HeaderMetadata<Block, Error = BlockChainError> + 'static,178 C: Send + Sync + 'static,179 C: BlockchainEvents<Block>,180 C: UsageProvider<Block>,181 C::Api: RuntimeApiDep<R>,182 P: TransactionPool<Block = Block> + 'static,183 CA: ChainApi<Block = Block> + 'static,184 B: sc_client_api::Backend<Block> + Send + Sync + 'static,185 C: sp_api::CallApiAt<Block>,186 CIDP: CreateInherentDataProviders<Block, ()> + Send + 'static,187 EC: EthConfig<Block, C>,188 R: RuntimeInstance,189{190 use fc_rpc::{191 Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, EthPubSub,192 EthPubSubApiServer, EthSigner, Net, NetApiServer, Web3, Web3ApiServer,193 };194195 let EthDeps {196 client,197 pool,198 graph,199 eth_backend,200 max_past_logs,201 fee_history_limit,202 fee_history_cache,203 eth_block_data_cache,204 eth_filter_pool,205 eth_pubsub_notification_sinks,206 enable_dev_signer,207 sync,208 is_authority,209 network,210 overrides,211 pending_create_inherent_data_providers,212 } = deps;213214 let mut signers = Vec::new();215 if enable_dev_signer {216 signers.push(Box::new(EthDevSigner::new()) as Box<dyn EthSigner>);217 }218 let execute_gas_limit_multiplier = 10;219 io.merge(220 Eth::<_, _, _, _, _, _, _, EC>::new(221 client.clone(),222 pool.clone(),223 graph.clone(),224 // We have no runtimes old enough to only accept converted transactions225 None::<NoTransactionConverter>,226 sync.clone(),227 signers,228 overrides.clone(),229 eth_backend.clone(),230 is_authority,231 eth_block_data_cache.clone(),232 fee_history_cache,233 fee_history_limit,234 execute_gas_limit_multiplier,235 None,236 pending_create_inherent_data_providers,237 Some(Box::new(AuraConsensusDataProvider::new(client.clone()))),238 )239 .into_rpc(),240 )?;241242 if let Some(filter_pool) = eth_filter_pool {243 io.merge(244 EthFilter::new(245 client.clone(),246 eth_backend,247 graph,248 filter_pool,249 500_usize, // max stored filters250 max_past_logs,251 eth_block_data_cache,252 )253 .into_rpc(),254 )?;255 }256 io.merge(257 Net::new(258 client.clone(),259 network,260 // Whether to format the `peer_count` response as Hex (default) or not.261 true,262 )263 .into_rpc(),264 )?;265 io.merge(Web3::new(client.clone()).into_rpc())?;266 io.merge(267 EthPubSub::new(268 pool,269 client,270 sync,271 subscription_task_executor,272 overrides,273 eth_pubsub_notification_sinks,274 )275 .into_rpc(),276 )?;277278 Ok(())279}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.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)
}
}
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 }