reth_provider/traits/
state.rsuse alloy_primitives::BlockNumber;
use reth_execution_types::ExecutionOutcome;
use reth_storage_errors::provider::ProviderResult;
use reth_trie::HashedPostStateSorted;
use revm::db::{
states::{PlainStateReverts, StateChangeset},
OriginalValuesKnown,
};
use std::ops::RangeInclusive;
pub trait StateWriter {
fn write_to_storage(
&mut self,
execution_outcome: ExecutionOutcome,
is_value_known: OriginalValuesKnown,
) -> ProviderResult<()>;
}
pub trait StateChangeWriter {
fn write_state_reverts(
&self,
reverts: PlainStateReverts,
first_block: BlockNumber,
) -> ProviderResult<()>;
fn write_state_changes(&self, changes: StateChangeset) -> ProviderResult<()>;
fn write_hashed_state(&self, hashed_state: &HashedPostStateSorted) -> ProviderResult<()>;
fn remove_state(&self, range: RangeInclusive<BlockNumber>) -> ProviderResult<()>;
fn take_state(&self, range: RangeInclusive<BlockNumber>) -> ProviderResult<ExecutionOutcome>;
}