#[repr(u8)]pub enum TxType {
Legacy = 0,
Eip2930 = 1,
Eip1559 = 2,
Eip4844 = 3,
Eip7702 = 4,
}
Expand description
The TxEnvelope enum represents all Ethereum transaction envelope types, /// Its variants correspond to specific allowed transactions:
- Legacy (pre-EIP2718)
TxLegacy
- EIP2930 (state access lists)
TxEip2930
- EIP1559
TxEip1559
- EIP4844
TxEip4844Variant
This type is generic over Eip4844 variant to support the following cases:
- Only-
crate::TxEip4844
transaction type, such transaction representation is returned by RPC and stored by nodes internally. - Only-
crate::TxEip4844WithSidecar
transactions which are broadcasted over the network, submitted to RPC and stored in transaction pool. - Dynamic
TxEip4844Variant
transactions to support both of the above cases via a single type.
Ethereum TransactionType
flags as specified in EIPs 2718, 1559, 2930, 4844, and
7702.
Variants§
Legacy = 0
Legacy transaction type.
Eip2930 = 1
EIP-2930 transaction type.
Eip1559 = 2
EIP-1559 transaction type.
Eip4844 = 3
EIP-4844 transaction type.
Eip7702 = 4
EIP-7702 transaction type.
Implementations§
Source§impl TxType
impl TxType
Sourcepub const fn is_eip2930(&self) -> bool
pub const fn is_eip2930(&self) -> bool
Returns true if the transaction type is EIP-2930.
Sourcepub const fn is_eip1559(&self) -> bool
pub const fn is_eip1559(&self) -> bool
Returns true if the transaction type is EIP-1559.
Sourcepub const fn is_eip4844(&self) -> bool
pub const fn is_eip4844(&self) -> bool
Returns true if the transaction type is EIP-4844.
Sourcepub const fn is_eip7702(&self) -> bool
pub const fn is_eip7702(&self) -> bool
Returns true if the transaction type is EIP-7702.
Sourcepub const fn is_dynamic_fee(&self) -> bool
pub const fn is_dynamic_fee(&self) -> bool
Returns true if the transaction type has dynamic fee.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TxType
impl<'de> Deserialize<'de> for TxType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IsTyped2718 for TxType
impl IsTyped2718 for TxType
Source§impl Ord for TxType
impl Ord for TxType
Source§impl PartialOrd for TxType
impl PartialOrd for TxType
Source§impl Typed2718 for TxType
impl Typed2718 for TxType
Source§fn is_eip2930(&self) -> bool
fn is_eip2930(&self) -> bool
Returns true if the type is an EIP-2930 transaction.
Source§fn is_eip1559(&self) -> bool
fn is_eip1559(&self) -> bool
Returns true if the type is an EIP-1559 transaction.
Source§fn is_eip4844(&self) -> bool
fn is_eip4844(&self) -> bool
Returns true if the type is an EIP-4844 transaction.
Source§fn is_eip7702(&self) -> bool
fn is_eip7702(&self) -> bool
Returns true if the type is an EIP-7702 transaction.
impl Copy for TxType
impl Eq for TxType
impl StructuralPartialEq for TxType
Auto Trait Implementations§
impl Freeze for TxType
impl RefUnwindSafe for TxType
impl Send for TxType
impl Sync for TxType
impl Unpin for TxType
impl UnwindSafe for TxType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more