Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Jul 11, 2024
1 parent 887791f commit faf19fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions crates/optimism/cli/src/commands/import_receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use clap::Parser;
use reth_cli_commands::common::{AccessRights, Environment, EnvironmentArgs};
use reth_db::tables;
use reth_db_api::{database::Database, transaction::DbTx};
use reth_db_api::database::Database;
use reth_downloaders::{
file_client::{ChunkedFileReader, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
file_codec_ovm_receipt::HackReceiptFileCodec,
Expand Down Expand Up @@ -109,8 +109,6 @@ where
);
}

// prepare the tx for `write_to_storage`
let tx = provider.into_tx();
let mut total_decoded_receipts = 0;
let mut total_filtered_out_dup_txns = 0;

Expand Down Expand Up @@ -149,14 +147,14 @@ where
static_file_provider.get_writer(first_block, StaticFileSegment::Receipts)?;

// finally, write the receipts
execution_outcome.write_to_storage::<DB::TXMut>(
&tx,
execution_outcome.write_to_storage(
&provider,
Some(static_file_producer),
OriginalValuesKnown::Yes,
)?;
}

tx.commit()?;
provider.commit()?;
// as static files works in file ranges, internally it will be committing when creating the
// next file range already, so we only need to call explicitly at the end.
static_file_provider.commit()?;
Expand Down
2 changes: 1 addition & 1 deletion crates/stages/stages/src/stages/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ where

let time = Instant::now();
// write output
state.write_to_storage(&provider, static_file_producer, OriginalValuesKnown::Yes)?;
state.write_to_storage(provider, static_file_producer, OriginalValuesKnown::Yes)?;
let db_write_duration = time.elapsed();
debug!(
target: "sync::stages::execution",
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/db-common/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ fn parse_accounts(
/// Takes a [`Collector`] and processes all accounts.
fn dump_state<DB: Database>(
mut collector: Collector<Address, GenesisAccount>,
provider_rw: &mut DatabaseProviderRW<DB>,
provider_rw: &DatabaseProviderRW<DB>,
block: u64,
) -> Result<(), eyre::Error> {
let accounts_len = collector.len();
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3264,7 +3264,7 @@ impl<DB: Database> BlockWriter for DatabaseProviderRW<DB> {

// Write state and changesets to the database.
// Must be written after blocks because of the receipt lookup.
execution_outcome.write_to_storage(&self, None, OriginalValuesKnown::No)?;
execution_outcome.write_to_storage(self, None, OriginalValuesKnown::No)?;
durations_recorder.record_relative(metrics::Action::InsertState);

// insert hashes and intermediate merkle nodes
Expand Down

0 comments on commit faf19fe

Please sign in to comment.