pub trait StateWriter {
type Receipt: 'static;
// Required methods
fn write_state<'a>(
&self,
execution_outcome: impl Into<WriteStateInput<'a, Self::Receipt>>,
is_value_known: OriginalValuesKnown,
config: StateWriteConfig,
) -> ProviderResult<()>;
fn write_state_reverts(
&self,
reverts: PlainStateReverts,
first_block: BlockNumber,
config: StateWriteConfig,
) -> ProviderResult<()>;
fn write_state_changes(&self, changes: StateChangeset) -> ProviderResult<()>;
fn write_hashed_state(
&self,
hashed_state: &HashedPostStateSorted,
) -> ProviderResult<()>;
fn remove_state_above(&self, block: BlockNumber) -> ProviderResult<()>;
fn take_state_above(
&self,
block: BlockNumber,
) -> ProviderResult<ExecutionOutcome<Self::Receipt>>;
}Expand description
A trait specifically for writing state changes or reverts
Required Associated Types§
Required Methods§
Sourcefn write_state<'a>(
&self,
execution_outcome: impl Into<WriteStateInput<'a, Self::Receipt>>,
is_value_known: OriginalValuesKnown,
config: StateWriteConfig,
) -> ProviderResult<()>
fn write_state<'a>( &self, execution_outcome: impl Into<WriteStateInput<'a, Self::Receipt>>, is_value_known: OriginalValuesKnown, config: StateWriteConfig, ) -> ProviderResult<()>
Write the state and optionally receipts to the database.
Use config to skip writing certain data types when they are written elsewhere.
Sourcefn write_state_reverts(
&self,
reverts: PlainStateReverts,
first_block: BlockNumber,
config: StateWriteConfig,
) -> ProviderResult<()>
fn write_state_reverts( &self, reverts: PlainStateReverts, first_block: BlockNumber, config: StateWriteConfig, ) -> ProviderResult<()>
Write state reverts to the database.
NOTE: Reverts will delete all wiped storage from plain state.
Use config to skip writing certain data types when they are written elsewhere.
Sourcefn write_state_changes(&self, changes: StateChangeset) -> ProviderResult<()>
fn write_state_changes(&self, changes: StateChangeset) -> ProviderResult<()>
Write state changes to the database.
Sourcefn write_hashed_state(
&self,
hashed_state: &HashedPostStateSorted,
) -> ProviderResult<()>
fn write_hashed_state( &self, hashed_state: &HashedPostStateSorted, ) -> ProviderResult<()>
Writes the hashed state changes to the database
Sourcefn remove_state_above(&self, block: BlockNumber) -> ProviderResult<()>
fn remove_state_above(&self, block: BlockNumber) -> ProviderResult<()>
Remove the block range of state above the given block. The state of the passed block is not removed.
Sourcefn take_state_above(
&self,
block: BlockNumber,
) -> ProviderResult<ExecutionOutcome<Self::Receipt>>
fn take_state_above( &self, block: BlockNumber, ) -> ProviderResult<ExecutionOutcome<Self::Receipt>>
Take the block range of state, recreating the [ExecutionOutcome]. The state of the passed
block is not removed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".