pub enum PooledTransaction {
Legacy(Signed<TxLegacy>),
Eip2930(Signed<TxEip2930>),
Eip1559(Signed<TxEip1559>),
Eip4844(Signed<TxEip4844WithSidecar>),
Eip7702(Signed<TxEip7702>),
}
Expand description
All possible transactions that can be included in a response to GetPooledTransactions
.
A response to GetPooledTransactions
. This can include either a blob transaction, or a
non-4844 signed transaction.
The difference between this and the TxEnvelope
is that this type always requires the
TxEip4844WithSidecar
variant, because EIP-4844 transaction can only be propagated with the
sidecar over p2p.
Variants§
Legacy(Signed<TxLegacy>)
An untagged TxLegacy
.
Eip2930(Signed<TxEip2930>)
A TxEip2930
tagged with type 1.
Eip1559(Signed<TxEip1559>)
A TxEip1559
tagged with type 2.
Eip4844(Signed<TxEip4844WithSidecar>)
A EIP-4844 transaction, which includes the transaction, blob data, commitments, and proofs.
Eip7702(Signed<TxEip7702>)
A TxEip7702
tagged with type 4.
Implementations§
source§impl PooledTransaction
impl PooledTransaction
sourcepub fn signature_hash(&self) -> B256
pub fn signature_hash(&self) -> B256
Heavy operation that return signature hash over rlp encoded transaction. It is only for signature signing or signer recovery.
sourcepub const fn hash(&self) -> &TxHash
pub const fn hash(&self) -> &TxHash
Reference to transaction hash. Used to identify transaction.
sourcepub fn encode_for_signing(&self, out: &mut dyn BufMut)
pub fn encode_for_signing(&self, out: &mut dyn BufMut)
This encodes the transaction without the signature, and is only suitable for creating a hash intended for signing.
sourcepub fn into_envelope(self) -> TxEnvelope
pub fn into_envelope(self) -> TxEnvelope
Converts the transaction into TxEnvelope
.
sourcepub const fn as_legacy(&self) -> Option<&TxLegacy>
pub const fn as_legacy(&self) -> Option<&TxLegacy>
Returns the TxLegacy
variant if the transaction is a legacy transaction.
sourcepub const fn as_eip2930(&self) -> Option<&TxEip2930>
pub const fn as_eip2930(&self) -> Option<&TxEip2930>
Returns the TxEip2930
variant if the transaction is an EIP-2930 transaction.
sourcepub const fn as_eip1559(&self) -> Option<&TxEip1559>
pub const fn as_eip1559(&self) -> Option<&TxEip1559>
Returns the TxEip1559
variant if the transaction is an EIP-1559 transaction.
sourcepub const fn as_eip4844_with_sidecar(&self) -> Option<&TxEip4844WithSidecar>
pub const fn as_eip4844_with_sidecar(&self) -> Option<&TxEip4844WithSidecar>
Returns the TxEip4844WithSidecar
variant if the transaction is an EIP-4844 transaction.
sourcepub const fn as_eip4844(&self) -> Option<&TxEip4844>
pub const fn as_eip4844(&self) -> Option<&TxEip4844>
Returns the TxEip4844
variant if the transaction is an EIP-4844 transaction.
sourcepub const fn as_eip7702(&self) -> Option<&TxEip7702>
pub const fn as_eip7702(&self) -> Option<&TxEip7702>
Returns the TxEip7702
variant if the transaction is an EIP-7702 transaction.
sourcepub fn try_into_legacy(self) -> Result<Signed<TxLegacy>, Self>
pub fn try_into_legacy(self) -> Result<Signed<TxLegacy>, Self>
Attempts to unwrap the transaction into a legacy transaction variant.
If the transaction is not a legacy transaction, it will return Err(self)
.
sourcepub fn try_into_eip2930(self) -> Result<Signed<TxEip2930>, Self>
pub fn try_into_eip2930(self) -> Result<Signed<TxEip2930>, Self>
Attempts to unwrap the transaction into an EIP-2930 transaction variant.
If the transaction is not an EIP-2930 transaction, it will return Err(self)
.
sourcepub fn try_into_eip1559(self) -> Result<Signed<TxEip1559>, Self>
pub fn try_into_eip1559(self) -> Result<Signed<TxEip1559>, Self>
Attempts to unwrap the transaction into an EIP-1559 transaction variant.
If the transaction is not an EIP-1559 transaction, it will return Err(self)
.
sourcepub fn try_into_eip4844(self) -> Result<Signed<TxEip4844WithSidecar>, Self>
pub fn try_into_eip4844(self) -> Result<Signed<TxEip4844WithSidecar>, Self>
Attempts to unwrap the transaction into an EIP-4844 transaction variant.
If the transaction is not an EIP-4844 transaction, it will return Err(self)
.
sourcepub fn try_into_eip7702(self) -> Result<Signed<TxEip7702>, Self>
pub fn try_into_eip7702(self) -> Result<Signed<TxEip7702>, Self>
Attempts to unwrap the transaction into an EIP-7702 transaction variant.
If the transaction is not an EIP-7702 transaction, it will return Err(self)
.
Trait Implementations§
source§impl Clone for PooledTransaction
impl Clone for PooledTransaction
source§fn clone(&self) -> PooledTransaction
fn clone(&self) -> PooledTransaction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PooledTransaction
impl Debug for PooledTransaction
source§impl Decodable for PooledTransaction
impl Decodable for PooledTransaction
source§impl Decodable2718 for PooledTransaction
impl Decodable2718 for PooledTransaction
source§fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
fn typed_decode(ty: u8, buf: &mut &[u8]) -> Eip2718Result<Self>
source§fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
fn fallback_decode(buf: &mut &[u8]) -> Eip2718Result<Self>
source§fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
source§fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
source§fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn network_decode(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
source§impl<'de> Deserialize<'de> for PooledTransaction
impl<'de> Deserialize<'de> for PooledTransaction
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>,
source§impl Encodable for PooledTransaction
impl Encodable for PooledTransaction
source§fn encode(&self, out: &mut dyn BufMut)
fn encode(&self, out: &mut dyn BufMut)
This encodes the transaction with the signature, and an rlp header.
For legacy transactions, it encodes the transaction data:
rlp(tx-data)
For EIP-2718 typed transactions, it encodes the transaction type followed by the rlp of the
transaction:
rlp(tx-type || rlp(tx-data))
source§impl Encodable2718 for PooledTransaction
impl Encodable2718 for PooledTransaction
source§fn encode_2718_len(&self) -> usize
fn encode_2718_len(&self) -> usize
source§fn encode_2718(&self, out: &mut dyn BufMut)
fn encode_2718(&self, out: &mut dyn BufMut)
source§fn trie_hash(&self) -> B256
fn trie_hash(&self) -> B256
source§fn encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
source§fn network_len(&self) -> usize
fn network_len(&self) -> usize
source§fn network_encode(&self, out: &mut dyn BufMut)
fn network_encode(&self, out: &mut dyn BufMut)
source§impl From<PooledTransaction> for TxEnvelope
impl From<PooledTransaction> for TxEnvelope
source§fn from(tx: PooledTransaction) -> Self
fn from(tx: PooledTransaction) -> Self
source§impl From<Signed<TxEip4844WithSidecar>> for PooledTransaction
impl From<Signed<TxEip4844WithSidecar>> for PooledTransaction
source§fn from(v: Signed<TxEip4844WithSidecar>) -> Self
fn from(v: Signed<TxEip4844WithSidecar>) -> Self
source§impl Hash for PooledTransaction
impl Hash for PooledTransaction
source§impl PartialEq for PooledTransaction
impl PartialEq for PooledTransaction
source§fn eq(&self, other: &PooledTransaction) -> bool
fn eq(&self, other: &PooledTransaction) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PooledTransaction
impl Serialize for PooledTransaction
source§impl Transaction for PooledTransaction
impl Transaction for PooledTransaction
source§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
source§fn max_priority_fee_per_gas(&self) -> Option<u128>
fn max_priority_fee_per_gas(&self) -> Option<u128>
source§fn max_fee_per_blob_gas(&self) -> Option<u128>
fn max_fee_per_blob_gas(&self) -> Option<u128>
source§fn priority_fee_or_price(&self) -> u128
fn priority_fee_or_price(&self) -> u128
source§fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
source§fn is_dynamic_fee(&self) -> bool
fn is_dynamic_fee(&self) -> bool
true
if the transaction supports dynamic fees.source§fn is_create(&self) -> bool
fn is_create(&self) -> bool
kind
as it copies the 21-byte
TxKind
for this simple check. A proper implementation shouldn’t allocate.source§fn access_list(&self) -> Option<&AccessList>
fn access_list(&self) -> Option<&AccessList>
access_list
for the particular transaction type. Returns None
for
older transaction types.source§fn blob_versioned_hashes(&self) -> Option<&[B256]>
fn blob_versioned_hashes(&self) -> Option<&[B256]>
None
.SignedAuthorization
list of the transaction. Read moresource§fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
source§impl Typed2718 for PooledTransaction
impl Typed2718 for PooledTransaction
source§fn is_eip2930(&self) -> bool
fn is_eip2930(&self) -> bool
source§fn is_eip1559(&self) -> bool
fn is_eip1559(&self) -> bool
source§fn is_eip4844(&self) -> bool
fn is_eip4844(&self) -> bool
source§fn is_eip7702(&self) -> bool
fn is_eip7702(&self) -> bool
impl Eq for PooledTransaction
impl StructuralPartialEq for PooledTransaction
Auto Trait Implementations§
impl !Freeze for PooledTransaction
impl RefUnwindSafe for PooledTransaction
impl Send for PooledTransaction
impl Sync for PooledTransaction
impl Unpin for PooledTransaction
impl UnwindSafe for PooledTransaction
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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
key
and return true
if they are equal.