Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary mut #5318

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions substrate/client/consensus/common/src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub async fn import_single_block<B: BlockT, V: Verifier<B>>(
import_handle: &mut impl BlockImport<B, Error = ConsensusError>,
block_origin: BlockOrigin,
block: IncomingBlock<B>,
verifier: &mut V,
verifier: &V,
) -> BlockImportResult<B> {
match verify_single_block_metered(import_handle, block_origin, block, verifier, None).await? {
SingleBlockVerificationOutcome::Imported(import_status) => Ok(import_status),
Expand Down Expand Up @@ -295,7 +295,7 @@ pub(crate) async fn verify_single_block_metered<B: BlockT, V: Verifier<B>>(
import_handle: &impl BlockImport<B, Error = ConsensusError>,
block_origin: BlockOrigin,
block: IncomingBlock<B>,
verifier: &mut V,
verifier: &V,
metrics: Option<&Metrics>,
) -> Result<SingleBlockVerificationOutcome<B>, BlockImportError> {
let peer = block.origin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ mod worker_messages {
/// Returns when `block_import` ended.
async fn block_import_process<B: BlockT>(
mut block_import: BoxBlockImport<B>,
mut verifier: impl Verifier<B>,
verifier: impl Verifier<B>,
mut result_sender: BufferedLinkSender<B>,
mut block_import_receiver: TracingUnboundedReceiver<worker_messages::ImportBlocks<B>>,
metrics: Option<Metrics>,
Expand All @@ -241,8 +241,7 @@ async fn block_import_process<B: BlockT>(
};

let res =
import_many_blocks(&mut block_import, origin, blocks, &mut verifier, metrics.clone())
.await;
import_many_blocks(&mut block_import, origin, blocks, &verifier, metrics.clone()).await;

result_sender.blocks_processed(res.imported, res.block_count, res.results);
}
Expand Down Expand Up @@ -388,7 +387,7 @@ async fn import_many_blocks<B: BlockT, V: Verifier<B>>(
import_handle: &mut BoxBlockImport<B>,
blocks_origin: BlockOrigin,
blocks: Vec<IncomingBlock<B>>,
verifier: &mut V,
verifier: &V,
metrics: Option<Metrics>,
) -> ImportManyBlocksResult<B> {
let count = blocks.len();
Expand Down
6 changes: 3 additions & 3 deletions substrate/client/network/test/src/block_import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ fn import_single_good_block_works() {
&mut substrate_test_runtime_client::new(),
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Ok(BlockImportStatus::ImportedUnknown(ref num, ref aux, ref org))
if *num == number && *aux == expected_aux && *org == Some(peer_id.into()) => {},
Expand All @@ -93,7 +93,7 @@ fn import_single_good_known_block_is_ignored() {
&mut client,
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Ok(BlockImportStatus::ImportedKnown(ref n, _)) if *n == number => {},
_ => panic!(),
Expand All @@ -108,7 +108,7 @@ fn import_single_good_block_without_header_fails() {
&mut substrate_test_runtime_client::new(),
BlockOrigin::File,
block,
&mut PassThroughVerifier::new(true),
&PassThroughVerifier::new(true),
)) {
Err(BlockImportError::IncompleteHeader(ref org)) if *org == Some(peer_id.into()) => {},
_ => panic!(),
Expand Down
Loading