Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #135 from anton-rs/merklefruit/primitives-fill-tx-env
Browse files Browse the repository at this point in the history
chore(primitives): fill tx env in separate fn
  • Loading branch information
clabby authored Oct 30, 2023
2 parents 474b4f4 + 75eb78b commit 0b079b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 0 additions & 2 deletions crates/primitives/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,10 @@ pub const DEV_GENESIS_HASH: B256 =
b256!("2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c");

/// Optimism goerli genesis hash.
#[cfg(feature = "optimism")]
pub const GOERLI_OP_GENESIS: B256 =
b256!("c1fc15cd51159b1f1e5cbc4b82e85c1447ddfa33c52cf1d98d14fba0d6354be1");

/// Base goerli genesis hash.
#[cfg(feature = "optimism")]
pub const GOERLI_BASE_GENESIS: B256 =
b256!("a3ab140f15ea7f7443a4702da64c10314eb04d488e72974e02e2d728096b4f76");

Expand Down
13 changes: 8 additions & 5 deletions crates/primitives/src/revm/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,18 @@ pub fn fill_tx_env_with_beacon_root_contract_call(env: &mut Env, parent_beacon_b
}

/// Fill transaction environment from [TransactionSignedEcRecovered].
#[cfg(not(feature = "optimism"))]
pub fn fill_tx_env_with_recovered(tx_env: &mut TxEnv, transaction: &TransactionSignedEcRecovered) {
fill_tx_env(tx_env, transaction.as_ref(), transaction.signer());
}

/// Fill transaction environment from [TransactionSignedEcRecovered] and the given envelope.
#[cfg(feature = "optimism")]
pub fn fill_tx_env_with_recovered(
tx_env: &mut TxEnv,
transaction: &TransactionSignedEcRecovered,
#[cfg(feature = "optimism")] envelope: Bytes,
envelope: Bytes,
) {
#[cfg(not(feature = "optimism"))]
fill_tx_env(tx_env, transaction.as_ref(), transaction.signer());

#[cfg(feature = "optimism")]
fill_tx_env(tx_env, transaction.as_ref(), transaction.signer(), envelope);
}

Expand Down

0 comments on commit 0b079b7

Please sign in to comment.