Skip to content

Use alloy envelope macro for anvil's tx types #12389

@mattsse

Description

@mattsse

Component

Anvil

Describe the feature you would like

we now have this macro: https://github.com/alloy-rs/alloy/blob/c1987556cdcd0e99a1ce9c6512a8eea800df34fa/crates/consensus/src/transaction/envelope.rs#L162-L169

that generates a ton of boilerplate like rlp etc...

op equivalent:

https://github.com/alloy-rs/op-alloy/blob/b8fb592e663a50da0e458d993f3ad6c40b037c6f/crates/consensus/src/transaction/envelope.rs#L27

we have the same for anvil which is a superset of op and eth:

typed:

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum TypedTransaction {
/// Legacy transaction type
Legacy(Signed<TxLegacy>),
/// EIP-2930 transaction
EIP2930(Signed<TxEip2930>),
/// EIP-1559 transaction
EIP1559(Signed<TxEip1559>),
/// EIP-4844 transaction
EIP4844(Signed<TxEip4844Variant>),
/// EIP-7702 transaction
EIP7702(Signed<TxEip7702>),
/// op-stack deposit transaction
Deposit(TxDeposit),
}

#[derive(Clone, Debug, PartialEq, Eq)]

TODO

  • use alloy macro for those two types and remove redundant code where possible

Additional context

No response

Metadata

Metadata

Assignees

Labels

T-featureType: featureT-needs-triageType: this issue needs to be labelled

Type

No type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions