pub trait FoundryEvmFactory:
EvmFactory<Precompiles = PrecompilesMap>
+ Clone
+ Debug
+ Default
+ 'staticwhere
Self::Spec: Into<SpecId> + ExecutionSpec + Default + Copy + Unpin + Send + 'static,
Self::BlockEnv: FoundryBlock + ForkBlockEnv + Default + Unpin,
Self::Tx: Clone + Debug + FoundryTransaction + FromAnyRpcTransaction + Default + Send + Sync,
Self::HaltReason: IntoInstructionResult,{
type Chain: FoundryChain<Self::Tx>;
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain>
where <Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal,
<Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>,
Self: 'db;
type FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason> + DerefMut<Target = Self::FoundryContext<'db>>
where Self: 'db;
// Required methods
fn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>
where I: FoundryInspectorExt<Self::FoundryContext<'db>>;
fn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db>
where I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db;
// Provided method
fn create_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db> { ... }
}Required Associated Types§
Sourcetype Chain: FoundryChain<Self::Tx>
type Chain: FoundryChain<Self::Tx>
Chain type for EVM’s context created by this factory.
Sourcetype FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain>
where
<Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal,
<Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>,
Self: 'db
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec, Chain = Self::Chain> where <Self::FoundryContext<'db> as ContextTr>::Journal: FoundryJournal, <Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>, Self: 'db
Foundry Context abstraction
Sourcetype FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason> + DerefMut<Target = Self::FoundryContext<'db>>
where
Self: 'db
type FoundryEvm<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>: Evm<DB = &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, Tx = Self::Tx, BlockEnv = Self::BlockEnv, Spec = Self::Spec, HaltReason = Self::HaltReason> + DerefMut<Target = Self::FoundryContext<'db>> where Self: 'db
The Foundry-wrapped EVM type produced by this factory.
Required Methods§
Sourcefn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>where
I: FoundryInspectorExt<Self::FoundryContext<'db>>,
fn create_foundry_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Self::FoundryEvm<'db, I>where
I: FoundryInspectorExt<Self::FoundryContext<'db>>,
Creates a Foundry-wrapped EVM with the given inspector.
Callers carrying execution context must install it through the returned context’s
chain_mut before executing. This also preserves OP’s block-derived L1 fee information.
Sourcefn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db>where
I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db,
fn create_nested_evm_with_inspector<'db, I>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: I,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db>where
I: FoundryInspectorExt<Self::FoundryContext<'db>> + 'db,
Creates a Foundry-wrapped nested EVM with the given inspector.
Install inherited chain state with NestedEvm::chain_mut before executing or restoring
journal-derived state.
Provided Methods§
Sourcefn create_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db>
fn create_nested_evm<'db>( &self, db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, evm_env: EvmEnv<Self::Spec, Self::BlockEnv>, ) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Chain = Self::Chain, Tx = Self::Tx, Journal = <Self::FoundryContext<'db> as ContextTr>::Journal> + 'db>
Creates a Foundry-wrapped nested EVM without an inspector.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".