mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
Make ReceiptFileClient generic (#8955)
This commit is contained in:
@ -7,6 +7,7 @@ use reth_db::tables;
|
||||
use reth_db_api::{database::Database, transaction::DbTx};
|
||||
use reth_downloaders::{
|
||||
file_client::{ChunkedFileReader, DEFAULT_BYTE_LEN_CHUNK_CHAIN_FILE},
|
||||
file_codec_ovm_receipt::HackReceiptFileCodec,
|
||||
receipt_file_client::ReceiptFileClient,
|
||||
};
|
||||
use reth_execution_types::ExecutionOutcome;
|
||||
@ -115,10 +116,16 @@ where
|
||||
// open file
|
||||
let mut reader = ChunkedFileReader::new(path, chunk_len).await?;
|
||||
|
||||
while let Some(file_client) = reader.next_chunk::<ReceiptFileClient>().await? {
|
||||
while let Some(file_client) =
|
||||
reader.next_chunk::<ReceiptFileClient<HackReceiptFileCodec>>().await?
|
||||
{
|
||||
// create a new file client from chunk read from file
|
||||
let ReceiptFileClient { mut receipts, first_block, total_receipts: total_receipts_chunk } =
|
||||
file_client;
|
||||
let ReceiptFileClient {
|
||||
mut receipts,
|
||||
first_block,
|
||||
total_receipts: total_receipts_chunk,
|
||||
..
|
||||
} = file_client;
|
||||
|
||||
// mark these as decoded
|
||||
total_decoded_receipts += total_receipts_chunk;
|
||||
|
||||
Reference in New Issue
Block a user