diff --git a/crates/ethereum/evm/src/lib.rs b/crates/ethereum/evm/src/lib.rs index b854b78ac012..8f9b2225707f 100644 --- a/crates/ethereum/evm/src/lib.rs +++ b/crates/ethereum/evm/src/lib.rs @@ -48,6 +48,8 @@ impl EthEvmConfig { } impl ConfigureEvmEnv for EthEvmConfig { + type Header = Header; + fn fill_cfg_env( &self, cfg_env: &mut CfgEnvWithHandlerCfg, diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index 04f476143ed3..067f1e35ba17 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -108,6 +108,9 @@ pub trait ConfigureEvm: ConfigureEvmEnv { /// Default trait method implementation is done w.r.t. L1. #[auto_impl::auto_impl(&, Arc)] pub trait ConfigureEvmEnv: Send + Sync + Unpin + Clone + 'static { + /// The header type used by the EVM. + type Header; + /// Returns a [`TxEnv`] from a [`TransactionSignedEcRecovered`]. fn tx_env(&self, transaction: &TransactionSignedEcRecovered) -> TxEnv { let mut tx_env = TxEnv::default(); diff --git a/crates/optimism/evm/src/lib.rs b/crates/optimism/evm/src/lib.rs index 3867fe8dab4d..d650bd27dba9 100644 --- a/crates/optimism/evm/src/lib.rs +++ b/crates/optimism/evm/src/lib.rs @@ -50,6 +50,8 @@ impl OptimismEvmConfig { } impl ConfigureEvmEnv for OptimismEvmConfig { + type Header = Header; + fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) { transaction.fill_tx_env(tx_env, sender); } diff --git a/examples/custom-evm/src/main.rs b/examples/custom-evm/src/main.rs index 1ddc53d1e272..8f5840a145e2 100644 --- a/examples/custom-evm/src/main.rs +++ b/examples/custom-evm/src/main.rs @@ -87,6 +87,8 @@ impl MyEvmConfig { } impl ConfigureEvmEnv for MyEvmConfig { + type Header = Header; + fn fill_cfg_env( &self, cfg_env: &mut CfgEnvWithHandlerCfg, diff --git a/examples/stateful-precompile/src/main.rs b/examples/stateful-precompile/src/main.rs index ae5b9feab97e..0ecb7f57dc00 100644 --- a/examples/stateful-precompile/src/main.rs +++ b/examples/stateful-precompile/src/main.rs @@ -144,6 +144,8 @@ impl StatefulPrecompileMut for WrappedPrecompile { } impl ConfigureEvmEnv for MyEvmConfig { + type Header = Header; + fn fill_tx_env(&self, tx_env: &mut TxEnv, transaction: &TransactionSigned, sender: Address) { self.inner.fill_tx_env(tx_env, transaction, sender) }