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

Commit

Permalink
feature: impl Default for eip2718::TypedTransaction (#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich authored Dec 3, 2021
1 parent 437f9de commit 0f6d368
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ethers-core/src/types/transaction/eip2718.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ pub enum TypedTransaction {
Eip1559(Eip1559TransactionRequest),
}

#[cfg(feature = "legacy")]
impl Default for TypedTransaction {
fn default() -> Self {
TypedTransaction::Legacy(Default::default())
}
}

#[cfg(not(feature = "legacy"))]
impl Default for TypedTransaction {
fn default() -> Self {
TypedTransaction::Eip1559(Default::default())
}
}

use TypedTransaction::*;

impl TypedTransaction {
Expand Down

0 comments on commit 0f6d368

Please sign in to comment.