chore: fix clippy errors (#9845)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
nk_ysg
2024-07-27 13:33:29 +08:00
committed by GitHub
parent 1ffa3d147d
commit 7df42454c0
10 changed files with 43 additions and 38 deletions

View File

@ -172,13 +172,13 @@ impl Command {
debug!(target: "reth::cli", bytes = ?tx_bytes, "Decoding transaction");
let transaction = TransactionSigned::decode(&mut &Bytes::from_str(tx_bytes)?[..])?
.into_ecrecovered()
.ok_or(eyre::eyre!("failed to recover tx"))?;
.ok_or_else(|| eyre::eyre!("failed to recover tx"))?;
let encoded_length = match &transaction.transaction {
Transaction::Eip4844(TxEip4844 { blob_versioned_hashes, .. }) => {
let blobs_bundle = blobs_bundle.as_mut().ok_or(eyre::eyre!(
"encountered a blob tx. `--blobs-bundle-path` must be provided"
))?;
let blobs_bundle = blobs_bundle.as_mut().ok_or_else(|| {
eyre::eyre!("encountered a blob tx. `--blobs-bundle-path` must be provided")
})?;
let sidecar: BlobTransactionSidecar =
blobs_bundle.pop_sidecar(blob_versioned_hashes.len());

View File

@ -156,7 +156,9 @@ impl Command {
storage_writer.write_to_storage(execution_outcome, OriginalValuesKnown::Yes)?;
let checkpoint = Some(StageCheckpoint::new(
block_number.checked_sub(1).ok_or(eyre::eyre!("GenesisBlockHasNoParent"))?,
block_number
.checked_sub(1)
.ok_or_else(|| eyre::eyre!("GenesisBlockHasNoParent"))?,
));
let mut account_hashing_done = false;