Skip to content

Commit 037f0cf

Browse files
committed
Lint
1 parent 5fe8b6f commit 037f0cf

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

core/node/node_sync/src/batch_status_updater/mod.rs

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,13 @@ impl L1TransactionVerifier {
212212
let batch_hash = parsed_log.params.iter().find_map(|param| {
213213
(param.name == "batchHash")
214214
.then_some(param.value.clone())
215-
.and_then(ethabi::Token::into_fixed_bytes)
216-
.and_then(|bytes| Some(H256::from_slice(&bytes)))
215+
.and_then(ethabi::Token::into_fixed_bytes).map(|bytes| H256::from_slice(&bytes))
217216
}).expect("Missing expected `batchHash` parameter in `BlockCommit` event log");
218217

219218
let commitment = parsed_log.params.into_iter().find_map(|param| {
220219
(param.name == "commitment")
221220
.then_some(param.value)
222-
.and_then(ethabi::Token::into_fixed_bytes)
223-
.and_then(|bytes| Some(H256::from_slice(&bytes)))
221+
.and_then(ethabi::Token::into_fixed_bytes).map(|bytes| H256::from_slice(&bytes))
224222
}).expect("Missing expected `commitment` parameter in `BlockCommit` event log");
225223

226224
tracing::debug!(
@@ -260,7 +258,7 @@ impl L1TransactionVerifier {
260258
"Commit transaction {commit_tx_hash} for batch {} does not have `BlockCommit` event log",
261259
batch_number
262260
);
263-
return Err(err);
261+
Err(err)
264262
}
265263
}
266264

@@ -355,7 +353,7 @@ impl L1TransactionVerifier {
355353
"Prove transaction {prove_tx_hash} for batch {} does not have `BlocksVerification` event log",
356354
batch_number
357355
);
358-
return Err(err);
356+
Err(err)
359357
}
360358
}
361359

@@ -434,15 +432,13 @@ impl L1TransactionVerifier {
434432
let batch_hash = parsed_log.params.iter().find_map(|param| {
435433
(param.name == "batchHash")
436434
.then_some(param.value.clone())
437-
.and_then(ethabi::Token::into_fixed_bytes)
438-
.and_then(|bytes| Some(H256::from_slice(&bytes)))
435+
.and_then(ethabi::Token::into_fixed_bytes).map(|bytes| H256::from_slice(&bytes))
439436
}).expect("Missing expected `batchHash` parameter in `BlockExecution` event log");
440437

441438
let commitment = parsed_log.params.into_iter().find_map(|param| {
442439
(param.name == "commitment")
443440
.then_some(param.value)
444-
.and_then(ethabi::Token::into_fixed_bytes)
445-
.and_then(|bytes| Some(H256::from_slice(&bytes)))
441+
.and_then(ethabi::Token::into_fixed_bytes).map(|bytes| H256::from_slice(&bytes))
446442
}).expect("Missing expected `commitment` parameter in `BlockExecution` event log");
447443

448444
tracing::debug!(
@@ -482,7 +478,7 @@ impl L1TransactionVerifier {
482478
"Execute transaction {execute_tx_hash} for batch {} does not have the corresponding `BlockExecution` event log",
483479
batch_number
484480
);
485-
return Err(err);
481+
Err(err)
486482
}
487483
}
488484
}
@@ -543,7 +539,7 @@ impl UpdaterCursor {
543539
));
544540
}
545541
// Validate the commit transaction against the database.
546-
let _ = l1_transaction_verifier
542+
l1_transaction_verifier
547543
.validate_commit_tx_against_db(commit_tx_hash, batch_info.number)
548544
.await
549545
.context("Failed to validate commit transaction against the database")?;
@@ -566,7 +562,7 @@ impl UpdaterCursor {
566562
));
567563
}
568564
// Validate the prove transaction events.
569-
let _ = l1_transaction_verifier
565+
l1_transaction_verifier
570566
.validate_prove_tx(prove_tx_hash, batch_info.number)
571567
.await
572568
.context("Failed to validate prove transaction")?;
@@ -590,7 +586,7 @@ impl UpdaterCursor {
590586
));
591587
}
592588
// Validate the execute transaction events.
593-
let _ = l1_transaction_verifier
589+
l1_transaction_verifier
594590
.validate_execute_tx(execute_tx_hash, batch_info.number)
595591
.await
596592
.context("Failed to validate execute transaction")?;

core/node/node_sync/src/batch_status_updater/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use zksync_contracts::BaseSystemContractsHashes;
99
use zksync_node_genesis::{insert_genesis_batch, GenesisParams};
1010
use zksync_node_test_utils::{create_l1_batch, create_l2_block, prepare_recovery_snapshot};
1111
use zksync_types::{
12-
web3::{self, Bytes, Log, TransactionReceipt},
13-
L2BlockNumber, U256,
12+
web3::{TransactionReceipt},
13+
L2BlockNumber,
1414
};
1515

1616
use super::*;

0 commit comments

Comments
 (0)