mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
evm: wider use of RethEvmBuilder (#9944)
This commit is contained in:
@ -15,7 +15,6 @@ extern crate alloc;
|
||||
use reth_chainspec::{ChainSpec, Head};
|
||||
use reth_evm::{ConfigureEvm, ConfigureEvmEnv};
|
||||
use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned, U256};
|
||||
use reth_revm::{Database, EvmBuilder};
|
||||
use revm_primitives::{AnalysisKind, Bytes, CfgEnvWithHandlerCfg, Env, TxEnv, TxKind};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
@ -110,13 +109,6 @@ impl ConfigureEvmEnv for EthEvmConfig {
|
||||
impl ConfigureEvm for EthEvmConfig {
|
||||
type DefaultExternalContext<'a> = ();
|
||||
|
||||
fn evm<DB: Database>(
|
||||
&self,
|
||||
db: DB,
|
||||
) -> reth_revm::Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||
EvmBuilder::default().with_db(db).build()
|
||||
}
|
||||
|
||||
fn default_external_context<'a>(&self) -> Self::DefaultExternalContext<'a> {}
|
||||
}
|
||||
|
||||
|
||||
@ -44,7 +44,9 @@ pub trait ConfigureEvm: ConfigureEvmEnv {
|
||||
/// 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<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB>;
|
||||
fn evm<DB: Database>(&self, db: DB) -> Evm<'_, Self::DefaultExternalContext<'_>, DB> {
|
||||
RethEvmBuilder::new(db, self.default_external_context()).build()
|
||||
}
|
||||
|
||||
/// Returns a new EVM with the given database configured with the given environment settings,
|
||||
/// including the spec id.
|
||||
|
||||
Reference in New Issue
Block a user