mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
execution: make ConfigureEvm independent of chainspec argument (#10748)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
//! Optimism block executor.
|
||||
|
||||
use crate::{l1::ensure_create2_deployer, OptimismBlockExecutionError, OptimismEvmConfig};
|
||||
use crate::{
|
||||
l1::ensure_create2_deployer, OpChainSpec, OptimismBlockExecutionError, OptimismEvmConfig,
|
||||
};
|
||||
use alloy_primitives::{BlockNumber, U256};
|
||||
use reth_chainspec::{ChainSpec, EthereumHardforks, OptimismHardfork};
|
||||
use reth_evm::{
|
||||
@ -36,7 +38,10 @@ pub struct OpExecutorProvider<EvmConfig = OptimismEvmConfig> {
|
||||
impl OpExecutorProvider {
|
||||
/// Creates a new default optimism executor provider.
|
||||
pub fn optimism(chain_spec: Arc<ChainSpec>) -> Self {
|
||||
Self::new(chain_spec, Default::default())
|
||||
Self::new(
|
||||
chain_spec.clone(),
|
||||
OptimismEvmConfig::new(Arc::new(OpChainSpec { inner: (*chain_spec).clone() })),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,7 +275,6 @@ where
|
||||
self.executor.evm_config.fill_cfg_and_block_env(
|
||||
&mut cfg,
|
||||
&mut block_env,
|
||||
self.chain_spec(),
|
||||
header,
|
||||
total_difficulty,
|
||||
);
|
||||
@ -442,6 +446,7 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::OpChainSpec;
|
||||
use alloy_primitives::{b256, Address, StorageKey, StorageValue};
|
||||
use reth_chainspec::ChainSpecBuilder;
|
||||
use reth_primitives::{
|
||||
@ -480,7 +485,12 @@ mod tests {
|
||||
}
|
||||
|
||||
fn executor_provider(chain_spec: Arc<ChainSpec>) -> OpExecutorProvider<OptimismEvmConfig> {
|
||||
OpExecutorProvider { chain_spec, evm_config: Default::default() }
|
||||
OpExecutorProvider {
|
||||
evm_config: OptimismEvmConfig::new(Arc::new(OpChainSpec {
|
||||
inner: (*chain_spec).clone(),
|
||||
})),
|
||||
chain_spec,
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user