From dde5cd8d9dcfa9318b68c19f4574f02c4a781bf2 Mon Sep 17 00:00:00 2001 From: Veer Chaurasia <142890355+VeerChaurasia@users.noreply.github.com> Date: Tue, 18 Feb 2025 13:48:41 +0530 Subject: [PATCH] Add Alias and update usage for emvenv (#14547) --- crates/evm/src/lib.rs | 3 +++ crates/rpc/rpc-eth-api/src/helpers/state.rs | 7 ++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/evm/src/lib.rs b/crates/evm/src/lib.rs index ce60e6586f..3e4a227fff 100644 --- a/crates/evm/src/lib.rs +++ b/crates/evm/src/lib.rs @@ -47,6 +47,9 @@ pub mod test_utils; pub use alloy_evm::{Database, Evm, EvmEnv, EvmError, InvalidTxError}; +/// Alias for `EvmEnv<::Spec>` +pub type EvmEnvFor = EvmEnv<::Spec>; + /// Helper trait to bound [`Inspector`] for a [`ConfigureEvm`]. pub trait InspectorFor: Inspector<>>::Context> diff --git a/crates/rpc/rpc-eth-api/src/helpers/state.rs b/crates/rpc/rpc-eth-api/src/helpers/state.rs index d3c07c1a30..df794f800c 100644 --- a/crates/rpc/rpc-eth-api/src/helpers/state.rs +++ b/crates/rpc/rpc-eth-api/src/helpers/state.rs @@ -10,7 +10,7 @@ use alloy_serde::JsonStorageKey; use futures::Future; use reth_chainspec::{EthChainSpec, EthereumHardforks}; use reth_errors::RethError; -use reth_evm::{ConfigureEvmEnv, EvmEnv}; +use reth_evm::{ConfigureEvmEnv, EvmEnvFor}; use reth_provider::{ BlockIdReader, BlockNumReader, ChainSpecProvider, StateProvider, StateProviderBox, StateProviderFactory, @@ -210,13 +210,10 @@ pub trait LoadState: /// for. /// If the [`BlockId`] is pending, this will return the "Pending" tag, otherwise this returns /// the hash of the exact block. - #[expect(clippy::type_complexity)] fn evm_env_at( &self, at: BlockId, - ) -> impl Future< - Output = Result<(EvmEnv<::Spec>, BlockId), Self::Error>, - > + Send + ) -> impl Future, BlockId), Self::Error>> + Send where Self: LoadPendingBlock + SpawnBlocking, {