feat: add functions for env creation (#12928)

This commit is contained in:
Matthias Seitz
2024-11-27 23:35:23 +01:00
committed by GitHub
parent 8d70e8921b
commit 2179301590
8 changed files with 39 additions and 60 deletions

View File

@ -15,10 +15,7 @@ use reth::{
providers::ProviderError,
revm::{
interpreter::Host,
primitives::{
address, Address, BlockEnv, Bytes, CfgEnvWithHandlerCfg, Env, EnvWithHandlerCfg,
TransactTo, TxEnv, U256,
},
primitives::{address, Address, Bytes, Env, EnvWithHandlerCfg, TransactTo, TxEnv, U256},
Database, DatabaseCommit, Evm, State,
},
};
@ -133,10 +130,7 @@ where
header: &alloy_consensus::Header,
total_difficulty: U256,
) -> EnvWithHandlerCfg {
let mut cfg = CfgEnvWithHandlerCfg::new(Default::default(), Default::default());
let mut block_env = BlockEnv::default();
self.evm_config.fill_cfg_and_block_env(&mut cfg, &mut block_env, header, total_difficulty);
let (cfg, block_env) = self.evm_config.cfg_and_block_env(header, total_difficulty);
EnvWithHandlerCfg::new_with_cfg_env(cfg, block_env, Default::default())
}
}