Skip to content

Commit 91cc693

Browse files
authored
refactor(anvil): remove TypedTransaction::as_legacy() method (#12633)
1 parent d9f47a7 commit 91cc693

File tree

2 files changed

+2
-9
lines changed
  • crates/anvil

2 files changed

+2
-9
lines changed

crates/anvil/core/src/eth/transaction/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -582,13 +582,6 @@ impl TypedTransaction {
582582
}
583583
}
584584

585-
pub fn as_legacy(&self) -> Option<&Signed<TxLegacy>> {
586-
match self {
587-
Self::Legacy(tx) => Some(tx),
588-
_ => None,
589-
}
590-
}
591-
592585
/// Returns the hash of the transaction.
593586
///
594587
/// Note: If this transaction has the Impersonated signature then this returns a modified unique

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3664,10 +3664,10 @@ impl TransactionValidator for Backend {
36643664
if let Some(tx_chain_id) = tx.chain_id() {
36653665
let chain_id = self.chain_id();
36663666
if chain_id.to::<u64>() != tx_chain_id {
3667-
if let Some(legacy) = tx.as_legacy() {
3667+
if let TypedTransaction::Legacy(tx) = tx.as_ref() {
36683668
// <https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md>
36693669
if env.evm_env.cfg_env.spec >= SpecId::SPURIOUS_DRAGON
3670-
&& legacy.tx().chain_id.is_none()
3670+
&& tx.chain_id().is_none()
36713671
{
36723672
warn!(target: "backend", ?chain_id, ?tx_chain_id, "incompatible EIP155-based V");
36733673
return Err(InvalidTransactionError::IncompatibleEIP155);

0 commit comments

Comments
 (0)