feature: impl Default for eip2718::TypedTransaction (#646)

This commit is contained in:
James Prestwich 2021-12-03 12:03:49 -08:00 committed by GitHub
parent 437f9de92f
commit 0f6d3688c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -34,6 +34,20 @@ pub enum TypedTransaction {
Eip1559(Eip1559TransactionRequest), 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::*; use TypedTransaction::*;
impl TypedTransaction { impl TypedTransaction {