mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 22:01:04 +00:00
Improve overall performance (#6699)
* Improve overall performance * Clean up code Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove needless :: Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
@@ -438,7 +438,7 @@ impl ServiceBuilder<(), (), (), (), (), (), (), (), (), (), ()> {
|
||||
backend,
|
||||
task_manager,
|
||||
keystore,
|
||||
fetcher: Some(fetcher.clone()),
|
||||
fetcher: Some(fetcher),
|
||||
select_chain: None,
|
||||
import_queue: (),
|
||||
finality_proof_request_builder: None,
|
||||
@@ -1286,7 +1286,7 @@ fn gen_handler<TBl, TBackend, TExPool, TRpc, TCl>(
|
||||
client.clone(),
|
||||
subscriptions.clone(),
|
||||
remote_backend.clone(),
|
||||
on_demand.clone()
|
||||
on_demand,
|
||||
);
|
||||
(chain, state, child_state)
|
||||
|
||||
@@ -1298,15 +1298,15 @@ fn gen_handler<TBl, TBackend, TExPool, TRpc, TCl>(
|
||||
};
|
||||
|
||||
let author = sc_rpc::author::Author::new(
|
||||
client.clone(),
|
||||
transaction_pool.clone(),
|
||||
client,
|
||||
transaction_pool,
|
||||
subscriptions,
|
||||
keystore.clone(),
|
||||
keystore,
|
||||
deny_unsafe,
|
||||
);
|
||||
let system = system::System::new(system_info, system_rpc_tx.clone(), deny_unsafe);
|
||||
let system = system::System::new(system_info, system_rpc_tx, deny_unsafe);
|
||||
|
||||
let maybe_offchain_rpc = offchain_storage.clone()
|
||||
let maybe_offchain_rpc = offchain_storage
|
||||
.map(|storage| {
|
||||
let offchain = sc_rpc::offchain::Offchain::new(storage, deny_unsafe);
|
||||
// FIXME: Use plain Option (don't collect into HashMap) when we upgrade to jsonrpc 14.1
|
||||
@@ -1357,7 +1357,7 @@ fn build_network<TBl, TExPool, TImpQu, TCl>(
|
||||
{
|
||||
let transaction_pool_adapter = Arc::new(TransactionPoolAdapter {
|
||||
imports_external_transactions: !matches!(config.role, Role::Light),
|
||||
pool: transaction_pool.clone(),
|
||||
pool: transaction_pool,
|
||||
client: client.clone(),
|
||||
});
|
||||
|
||||
@@ -1391,8 +1391,8 @@ fn build_network<TBl, TExPool, TImpQu, TCl>(
|
||||
chain: client.clone(),
|
||||
finality_proof_provider,
|
||||
finality_proof_request_builder,
|
||||
on_demand: on_demand.clone(),
|
||||
transaction_pool: transaction_pool_adapter.clone() as _,
|
||||
on_demand: on_demand,
|
||||
transaction_pool: transaction_pool_adapter as _,
|
||||
import_queue: Box::new(import_queue),
|
||||
protocol_id,
|
||||
block_announce_validator,
|
||||
@@ -1407,7 +1407,7 @@ fn build_network<TBl, TExPool, TImpQu, TCl>(
|
||||
let future = build_network_future(
|
||||
config.role.clone(),
|
||||
network_mut,
|
||||
client.clone(),
|
||||
client,
|
||||
network_status_sinks.clone(),
|
||||
system_rpc_rx,
|
||||
has_bootnodes,
|
||||
|
||||
@@ -52,8 +52,8 @@ impl<B: BlockT> BlockRules<B> {
|
||||
bad_blocks: BadBlocks<B>,
|
||||
) -> Self {
|
||||
Self {
|
||||
bad: bad_blocks.unwrap_or(HashSet::new()),
|
||||
forks: fork_blocks.unwrap_or(vec![]).into_iter().collect(),
|
||||
bad: bad_blocks.unwrap_or_else(|| HashSet::new()),
|
||||
forks: fork_blocks.unwrap_or_else(|| vec![]).into_iter().collect(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ pub fn sync<G, E, Fb, F, Lb, L, B, ExF, U>(
|
||||
let temp = tempdir_with_prefix("substrate-sync-test");
|
||||
let mut network = TestNet::new(
|
||||
&temp,
|
||||
spec.clone(),
|
||||
spec,
|
||||
(0..NUM_FULL_NODES).map(|_| { |cfg| full_builder(cfg) }),
|
||||
(0..NUM_LIGHT_NODES).map(|_| { |cfg| light_builder(cfg) }),
|
||||
// Note: this iterator is empty but we can't just use `iter::empty()`, otherwise
|
||||
@@ -592,7 +592,7 @@ pub fn consensus<G, E, Fb, F, Lb, L>(
|
||||
let temp = tempdir_with_prefix("substrate-consensus-test");
|
||||
let mut network = TestNet::new(
|
||||
&temp,
|
||||
spec.clone(),
|
||||
spec,
|
||||
(0..NUM_FULL_NODES / 2).map(|_| { |cfg| full_builder(cfg).map(|s| (s, ())) }),
|
||||
(0..NUM_LIGHT_NODES / 2).map(|_| { |cfg| light_builder(cfg) }),
|
||||
authorities.into_iter().map(|key| (key, { |cfg| full_builder(cfg).map(|s| (s, ())) })),
|
||||
|
||||
Reference in New Issue
Block a user