Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 0 additions & 7 deletions crates/anvil/core/src/eth/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,13 +582,6 @@ impl TypedTransaction {
}
}

pub fn as_legacy(&self) -> Option<&Signed<TxLegacy>> {
match self {
Self::Legacy(tx) => Some(tx),
_ => None,
}
}

/// Returns the hash of the transaction.
///
/// Note: If this transaction has the Impersonated signature then this returns a modified unique
Expand Down
4 changes: 2 additions & 2 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3664,10 +3664,10 @@ impl TransactionValidator for Backend {
if let Some(tx_chain_id) = tx.chain_id() {
let chain_id = self.chain_id();
if chain_id.to::<u64>() != tx_chain_id {
if let Some(legacy) = tx.as_legacy() {
if let TypedTransaction::Legacy(tx) = tx.as_ref() {
// <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>
if env.evm_env.cfg_env.spec >= SpecId::SPURIOUS_DRAGON
&& legacy.tx().chain_id.is_none()
&& tx.chain_id().is_none()
{
warn!(target: "backend", ?chain_id, ?tx_chain_id, "incompatible EIP155-based V");
return Err(InvalidTransactionError::IncompatibleEIP155);
Expand Down
Loading