mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-30 01:28:21 -05:00
chore: add commentes clarifying evm trait (#6857)
This commit is contained in:
@@ -5,11 +5,19 @@ use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg, SpecId, TxEnv};
|
||||
/// Trait for configuring the EVM for executing full blocks.
|
||||
pub trait ConfigureEvm: ConfigureEvmEnv {
|
||||
/// Returns new EVM with the given database
|
||||
///
|
||||
/// This does not automatically configure the EVM with [ConfigureEvmEnv] methods. It is up to
|
||||
/// the caller to call an appropriate method to fill the transaction and block environment
|
||||
/// before executing any transactions using the provided EVM.
|
||||
fn evm<'a, DB: Database + 'a>(&self, db: DB) -> Evm<'a, (), DB> {
|
||||
EvmBuilder::default().with_db(db).build()
|
||||
}
|
||||
|
||||
/// Returns a new EVM with the given inspector
|
||||
/// Returns a new EVM with the given inspector.
|
||||
///
|
||||
/// This does not automatically configure the EVM with [ConfigureEvmEnv] methods. It is up to
|
||||
/// the caller to call an appropriate method to fill the transaction and block environment
|
||||
/// before executing any transactions using the provided EVM.
|
||||
fn evm_with_inspector<'a, DB: Database + 'a, I>(&self, db: DB, inspector: I) -> Evm<'a, I, DB> {
|
||||
EvmBuilder::default().with_db(db).with_external_context(inspector).build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user