mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
20 lines
781 B
Rust
20 lines
781 B
Rust
use crate::providers::StaticFileProviderRWRefMut;
|
|
use reth_db::transaction::{DbTx, DbTxMut};
|
|
use reth_storage_errors::provider::ProviderResult;
|
|
use revm::db::OriginalValuesKnown;
|
|
|
|
/// A helper trait for [BundleStateWithReceipts](reth_execution_types::BundleStateWithReceipts) to
|
|
/// write state and receipts to storage.
|
|
pub trait StateWriter {
|
|
/// Write the data and receipts to the database or static files if `static_file_producer` is
|
|
/// `Some`. It should be `None` if there is any kind of pruning/filtering over the receipts.
|
|
fn write_to_storage<TX>(
|
|
self,
|
|
tx: &TX,
|
|
static_file_producer: Option<StaticFileProviderRWRefMut<'_>>,
|
|
is_value_known: OriginalValuesKnown,
|
|
) -> ProviderResult<()>
|
|
where
|
|
TX: DbTxMut + DbTx;
|
|
}
|