From 2aa5f5ddcd137b70bbfaa1f486f2d315c1e603f4 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 28 Feb 2024 16:47:15 -0500 Subject: [PATCH] chore: add commentes clarifying evm trait (#6857) --- crates/node-api/src/evm/traits.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/node-api/src/evm/traits.rs b/crates/node-api/src/evm/traits.rs index d0a8f3c418..bc0b900719 100644 --- a/crates/node-api/src/evm/traits.rs +++ b/crates/node-api/src/evm/traits.rs @@ -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() }