Trait FoundryEvmFactory
pub trait FoundryEvmFactory:
EvmFactory<Precompiles = PrecompilesMap>
+ Clone
+ Debug
+ Default
+ 'staticwhere
Self::Spec: Into<SpecId> + FromEvmVersion + Default + Copy + Unpin + Send + 'static,
Self::BlockEnv: FoundryBlock + ForkBlockEnv + Default + Unpin,
Self::Tx: Clone + Debug + FoundryTransaction + FromAnyRpcTransaction + Default + Send + Sync,
Self::HaltReason: IntoInstructionResult,{
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec>
where <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> + Deref<Target = Self::FoundryContext<'db>> + IntoNestedEvm<Self::Spec, Self::BlockEnv, Self::Tx>
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_foundry_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: &'db mut dyn FoundryInspectorExt<Self::FoundryContext<'db>>,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Tx = Self::Tx> + 'db>;
}Required Associated Types§
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec>
where
<Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>,
Self: 'db
type FoundryContext<'db>: FoundryContextExt<Block = Self::BlockEnv, Tx = Self::Tx, Spec = Self::Spec> where <Self::FoundryContext<'db> as ContextTr>::Db: DatabaseExt<Self>, Self: 'db
Foundry Context abstraction
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> + Deref<Target = Self::FoundryContext<'db>> + IntoNestedEvm<Self::Spec, Self::BlockEnv, Self::Tx>
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> + Deref<Target = Self::FoundryContext<'db>> + IntoNestedEvm<Self::Spec, Self::BlockEnv, Self::Tx> where Self: 'db
The Foundry-wrapped EVM type produced by this factory.
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_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.
fn create_foundry_nested_evm<'db>(
&self,
db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>,
evm_env: EvmEnv<Self::Spec, Self::BlockEnv>,
inspector: &'db mut dyn FoundryInspectorExt<Self::FoundryContext<'db>>,
) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Tx = Self::Tx> + 'db>
fn create_foundry_nested_evm<'db>( &self, db: &'db mut dyn DatabaseExt<Self, Error = DatabaseError>, evm_env: EvmEnv<Self::Spec, Self::BlockEnv>, inspector: &'db mut dyn FoundryInspectorExt<Self::FoundryContext<'db>>, ) -> Box<dyn NestedEvm<Spec = Self::Spec, Block = Self::BlockEnv, Tx = Self::Tx> + 'db>
Creates a Foundry-wrapped EVM with a dynamic inspector, returning a boxed NestedEvm.
This helper exists because &mut dyn FoundryInspectorExt<FoundryContext> cannot satisfy
the generic I: FoundryInspectorExt<Self::FoundryContext<'db>> bound when the context
type is only known through an associated type. Each concrete factory implements this
directly, side-stepping the higher-kinded lifetime issue.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.