docs: add docs for instantiating EthFilter (#14224)

Co-authored-by: Dan Cline <6798349+Rjected@users.noreply.github.com>
This commit is contained in:
Matthias Seitz
2025-02-05 02:12:33 +01:00
committed by GitHub
parent a9ae060452
commit 6d5607dc2b
4 changed files with 69 additions and 9 deletions

View File

@ -21,7 +21,7 @@ use alloc::{sync::Arc, vec::Vec};
use alloy_consensus::{BlockHeader, Header};
use alloy_primitives::{Address, U256};
use core::{convert::Infallible, fmt::Debug};
use reth_chainspec::{ChainSpec, EthChainSpec};
use reth_chainspec::{ChainSpec, EthChainSpec, MAINNET};
use reth_evm::{env::EvmEnv, ConfigureEvm, ConfigureEvmEnv, Database, Evm, NextBlockEnvAttributes};
use reth_primitives::TransactionSigned;
use reth_primitives_traits::transaction::execute::FillTxEnv;
@ -130,6 +130,11 @@ impl EthEvmConfig {
Self { chain_spec }
}
/// Creates a new Ethereum EVM configuration for the ethereum mainnet.
pub fn mainnet() -> Self {
Self::new(MAINNET.clone())
}
/// Returns the chain spec associated with this configuration.
pub const fn chain_spec(&self) -> &Arc<ChainSpec> {
&self.chain_spec