Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,7 @@ use alloy_consensus::{
Account, BlockHeader, EnvKzgSettings, Header, Receipt, ReceiptWithBloom, Signed,
Transaction as TransactionTrait, TxEnvelope,
};
use alloy_eips::{
eip1559::BaseFeeParams,
eip2718::{
EIP1559_TX_TYPE_ID, EIP2930_TX_TYPE_ID, EIP4844_TX_TYPE_ID, EIP7702_TX_TYPE_ID,
LEGACY_TX_TYPE_ID,
},
eip7840::BlobParams,
};
use alloy_eips::{eip1559::BaseFeeParams, eip7840::BlobParams};
use alloy_evm::{eth::EthEvmContext, precompiles::PrecompilesMap, Database, Evm};
use alloy_network::{
AnyHeader, AnyRpcBlock, AnyRpcHeader, AnyRpcTransaction, AnyTxEnvelope, AnyTxType,
Expand Down Expand Up @@ -1443,6 +1436,8 @@ impl Backend {
fee_details: FeeDetails,
block_env: BlockEnv,
) -> Env {
let tx_type = request.minimal_tx_type() as u8;

let WithOtherFields::<TransactionRequest> {
inner:
TransactionRequest {
Expand All @@ -1458,27 +1453,11 @@ impl Backend {
sidecar: _,
chain_id,
transaction_type,
max_fee_per_gas,
max_priority_fee_per_gas,
.. // Rest of the gas fees related fields are taken from `fee_details`
},
other,
} = request;

let tx_type = transaction_type.unwrap_or_else(|| {
if authorization_list.is_some() {
EIP7702_TX_TYPE_ID
} else if blob_versioned_hashes.is_some() {
EIP4844_TX_TYPE_ID
} else if max_fee_per_gas.is_some() || max_priority_fee_per_gas.is_some() {
EIP1559_TX_TYPE_ID
} else if access_list.is_some() {
EIP2930_TX_TYPE_ID
} else {
LEGACY_TX_TYPE_ID
}
});

let FeeDetails {
gas_price,
max_fee_per_gas,
Expand Down
Loading