Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
specify into_eip2930 when it matches a legacy tx
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed May 17, 2022
1 parent 086c04c commit f6bb408
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ethers-core/src/types/transaction/eip2718.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,12 @@ impl From<TypedTransaction> for TransactionRequest {

impl TypedTransaction {
fn into_eip2930(self) -> Eip2930TransactionRequest {
let access_list = self.access_list().cloned().unwrap_or_default();

match self {
Eip2930(tx) => tx,
_ => Eip2930TransactionRequest {
Legacy(tx) => Eip2930TransactionRequest { tx, access_list },
Eip1559(_) => Eip2930TransactionRequest {
tx: TransactionRequest {
from: self.from().copied(),
to: self.to().cloned(),
Expand Down

0 comments on commit f6bb408

Please sign in to comment.