pub trait FoundryEvmExt<Tx>:
SendableExt
+ Debug
+ Default
+ 'static {
// Provided methods
fn for_transaction(&mut self, _tx: &Recovered<Tx>) { ... }
fn for_block(
&mut self,
_grandparent: &[Recovered<Tx>],
_parent: &[Recovered<Tx>],
_current: &[Recovered<Tx>],
_index: usize,
) { ... }
fn replace_while_executing(&mut self, ext: Self) { ... }
fn is_protocol_transaction(_tx: &Recovered<Tx>) -> bool { ... }
fn set_preserve_transaction_state(&mut self, _preserve: bool) { ... }
fn set_protocol_replay(&mut self, _enabled: bool) { ... }
fn for_next_transaction(&mut self, tx: &Recovered<Tx>) { ... }
fn adopt_cursor(&mut self, _cursor: &Self) { ... }
fn resume_context(&mut self, ext: Self) { ... }
}Expand description
Per-EVM network state, such as OP L1 block info or Monad’s reserve-balance context.
Provided Methods§
Sourcefn for_transaction(&mut self, _tx: &Recovered<Tx>)
fn for_transaction(&mut self, _tx: &Recovered<Tx>)
Prepares the state for a standalone synthetic transaction.
Sourcefn for_block(
&mut self,
_grandparent: &[Recovered<Tx>],
_parent: &[Recovered<Tx>],
_current: &[Recovered<Tx>],
_index: usize,
)
fn for_block( &mut self, _grandparent: &[Recovered<Tx>], _parent: &[Recovered<Tx>], _current: &[Recovered<Tx>], _index: usize, )
Prepares the state for the transaction at index of current, a block whose parent and
grandparent blocks contained parent and grandparent, such as when replaying a block.
Sourcefn replace_while_executing(&mut self, ext: Self)
fn replace_while_executing(&mut self, ext: Self)
Replaces the state of an EVM that may be executing with ext, such as one restored by a
snapshot revert, keeping the state of the frames still executing.
Sourcefn is_protocol_transaction(_tx: &Recovered<Tx>) -> bool
fn is_protocol_transaction(_tx: &Recovered<Tx>) -> bool
Returns whether tx is a canonical protocol transaction of the network, such as a Monad
staking syscall, which only executes with Self::set_protocol_replay enabled.
Sourcefn set_preserve_transaction_state(&mut self, _preserve: bool)
fn set_preserve_transaction_state(&mut self, _preserve: bool)
Sets whether the next transaction continues the transaction state derived so far, such as Monad’s reserve-balance tracker, instead of starting its own. Isolated calls continue the running transaction’s.
Sourcefn set_protocol_replay(&mut self, _enabled: bool)
fn set_protocol_replay(&mut self, _enabled: bool)
Sets whether transactions from the network’s protocol sender execute as protocol transactions.
Enable it only to replay trusted canonical chain history, after preparing the transaction
with Self::for_transaction or Self::for_block, which disable it.
Sourcefn for_next_transaction(&mut self, tx: &Recovered<Tx>)
fn for_next_transaction(&mut self, tx: &Recovered<Tx>)
Prepares the state for a synthetic transaction appended at the retained block cursor,
such as a test call or vm.executeTransaction.
Networks without block-position state treat it as standalone (see
Self::for_transaction). The retained cursor itself does not move: only canonical
replays advance it, through Self::adopt_cursor.
Sourcefn adopt_cursor(&mut self, _cursor: &Self)
fn adopt_cursor(&mut self, _cursor: &Self)
Moves the retained block cursor to cursor’s, keeping the running transaction’s own
position at the new cursor and every other state.
Sourcefn resume_context(&mut self, ext: Self)
fn resume_context(&mut self, ext: Self)
Switches an EVM that may be executing to the parked context state ext, such as on a fork
switch.
Networks whose context state is only a block cursor, such as Monad, keep the running transaction’s own state and adopt the context’s cursor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FoundryEvmExt<BaseTxEnvelope> for BaseEvmExt
Available on crate feature base only.
impl FoundryEvmExt<BaseTxEnvelope> for BaseEvmExt
base only.fn replace_while_executing(&mut self, ext: Self)
Source§impl FoundryEvmExt<OpTxEnvelope> for OpEvmExt
Available on crate feature optimism only.
impl FoundryEvmExt<OpTxEnvelope> for OpEvmExt
optimism only.fn replace_while_executing(&mut self, ext: Self)
Source§impl FoundryEvmExt<TempoTxEnv> for TempoEvmExt
impl FoundryEvmExt<TempoTxEnv> for TempoEvmExt
fn resume_context(&mut self, _ext: Self)
Source§impl FoundryEvmExt<TxEnvelope> for MonadEvmExt
Available on crate feature monad only.
impl FoundryEvmExt<TxEnvelope> for MonadEvmExt
monad only.