Skip to content

Commit

Permalink
feat: add a helper to create txenv (#13979)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jan 24, 2025
1 parent abcfbfd commit d401dc5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

extern crate alloc;

use core::fmt::Debug;

use alloy_consensus::transaction::Recovered;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::{Address, Bytes, B256, U256};
use core::fmt::Debug;
use reth_primitives_traits::{BlockHeader, SignedTransaction};
use revm::{Database, DatabaseCommit, GetInspector};
use revm_primitives::{BlockEnv, EVMError, ResultAndState, TxEnv, TxKind};
Expand Down Expand Up @@ -188,6 +188,12 @@ pub trait ConfigureEvmEnv: Send + Sync + Unpin + Clone + 'static {
/// Returns a [`TxEnv`] from a transaction and [`Address`].
fn tx_env(&self, transaction: &Self::Transaction, signer: Address) -> Self::TxEnv;

/// Returns a [`TxEnv`] from a [`Recovered`] transaction.
fn tx_env_from_recovered(&self, tx: Recovered<&Self::Transaction>) -> Self::TxEnv {
let (tx, address) = tx.into_parts();
self.tx_env(tx, address)
}

/// Creates a new [`EvmEnv`] for the given header.
fn evm_env(&self, header: &Self::Header) -> EvmEnv<Self::Spec>;

Expand Down

0 comments on commit d401dc5

Please sign in to comment.