Type Alias PooledTransaction
pub type PooledTransaction = EthereumTxEnvelope<TxEip4844WithSidecar>;
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.
Aliased Type§
enum PooledTransaction {
Legacy(Signed<TxLegacy>),
Eip2930(Signed<TxEip2930>),
Eip1559(Signed<TxEip1559>),
Eip4844(Signed<TxEip4844WithSidecar>),
Eip7702(Signed<TxEip7702>),
}
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 TxEip4844 tagged with type 3. An EIP-4844 transaction has two network representations: 1 - The transaction itself, which is a regular RLP-encoded transaction and used to retrieve historical transactions..
2 - The transaction with a sidecar, which is the form used to send transactions to the network.
Eip7702(Signed<TxEip7702>)
A [TxEip7702
] tagged with type 4.
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 416 bytes
Size for each variant:
Legacy
: 256 bytesEip2930
: 272 bytesEip1559
: 288 bytesEip4844
: 400 bytesEip7702
: 304 bytes
Implementations
§impl<Eip4844> EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaEncodableTx,
impl<Eip4844> EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaEncodableTx,
pub const fn is_eip2930(&self) -> bool
pub const fn is_eip2930(&self) -> bool
Returns true if the transaction is an EIP-2930 transaction.
pub const fn is_eip1559(&self) -> bool
pub const fn is_eip1559(&self) -> bool
Returns true if the transaction is an EIP-1559 transaction.
pub const fn is_eip4844(&self) -> bool
pub const fn is_eip4844(&self) -> bool
Returns true if the transaction is an EIP-4844 transaction.
pub const fn is_eip7702(&self) -> bool
pub const fn is_eip7702(&self) -> bool
Returns true if the transaction is an EIP-7702 transaction.
pub fn into_signed(self) -> Signed<EthereumTypedTransaction<Eip4844>>where
EthereumTypedTransaction<Eip4844>: From<Eip4844>,
pub fn into_signed(self) -> Signed<EthereumTypedTransaction<Eip4844>>where
EthereumTypedTransaction<Eip4844>: From<Eip4844>,
Consumes the type into a [Signed
]
pub const fn is_replay_protected(&self) -> bool
pub const fn is_replay_protected(&self) -> bool
Returns true if the transaction is replay protected.
All non-legacy transactions are replay protected, as the chain id is
included in the transaction body. Legacy transactions are considered
replay protected if the v
value is not 27 or 28, according to the
rules of EIP-155.
pub const fn as_legacy(&self) -> Option<&Signed<TxLegacy>>
pub const fn as_legacy(&self) -> Option<&Signed<TxLegacy>>
Returns the [TxLegacy
] variant if the transaction is a legacy transaction.
pub const fn as_eip2930(&self) -> Option<&Signed<TxEip2930>>
pub const fn as_eip2930(&self) -> Option<&Signed<TxEip2930>>
Returns the [TxEip2930
] variant if the transaction is an EIP-2930 transaction.
pub const fn as_eip1559(&self) -> Option<&Signed<TxEip1559>>
pub const fn as_eip1559(&self) -> Option<&Signed<TxEip1559>>
Returns the [TxEip1559
] variant if the transaction is an EIP-1559 transaction.
pub const fn as_eip4844(&self) -> Option<&Signed<Eip4844>>
pub const fn as_eip4844(&self) -> Option<&Signed<Eip4844>>
Returns the [TxEip4844Variant
] variant if the transaction is an EIP-4844 transaction.
pub const fn as_eip7702(&self) -> Option<&Signed<TxEip7702>>
pub const fn as_eip7702(&self) -> Option<&Signed<TxEip7702>>
Returns the [TxEip7702
] variant if the transaction is an EIP-7702 transaction.
pub fn signature_hash(&self) -> FixedBytes<32>where
Eip4844: SignableTransaction<PrimitiveSignature>,
pub fn signature_hash(&self) -> FixedBytes<32>where
Eip4844: SignableTransaction<PrimitiveSignature>,
Calculate the signing hash for the transaction.
pub const fn signature(&self) -> &PrimitiveSignature
pub const fn signature(&self) -> &PrimitiveSignature
Return the reference to signature.
pub fn tx_hash(&self) -> &FixedBytes<32>
pub fn tx_hash(&self) -> &FixedBytes<32>
Return the hash of the inner Signed.
pub fn hash(&self) -> &FixedBytes<32>
pub fn hash(&self) -> &FixedBytes<32>
Reference to transaction hash. Used to identify transaction.
pub fn eip2718_encoded_length(&self) -> usize
pub fn eip2718_encoded_length(&self) -> usize
Return the length of the inner txn, including type byte length
§impl EthereumTxEnvelope<TxEip4844WithSidecar>
impl EthereumTxEnvelope<TxEip4844WithSidecar>
pub fn into_envelope(self) -> EthereumTxEnvelope<TxEip4844Variant>
pub fn into_envelope(self) -> EthereumTxEnvelope<TxEip4844Variant>
Converts the transaction into [TxEnvelope
].
Trait Implementations
§impl<Eip4844> Decodable for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaDecodableTx,
impl<Eip4844> Decodable for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaDecodableTx,
§impl<Eip4844> Decodable2718 for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaDecodableTx,
impl<Eip4844> Decodable2718 for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaDecodableTx,
§fn typed_decode(
ty: u8,
buf: &mut &[u8],
) -> Result<EthereumTxEnvelope<Eip4844>, Eip2718Error>
fn typed_decode( ty: u8, buf: &mut &[u8], ) -> Result<EthereumTxEnvelope<Eip4844>, Eip2718Error>
§fn fallback_decode(
buf: &mut &[u8],
) -> Result<EthereumTxEnvelope<Eip4844>, Eip2718Error>
fn fallback_decode( buf: &mut &[u8], ) -> Result<EthereumTxEnvelope<Eip4844>, Eip2718Error>
§fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
fn extract_type_byte(buf: &mut &[u8]) -> Option<u8>
§fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
fn decode_2718(buf: &mut &[u8]) -> Result<Self, Eip2718Error>
§impl<'de, Eip4844> Deserialize<'de> for EthereumTxEnvelope<Eip4844>
impl<'de, Eip4844> Deserialize<'de> for EthereumTxEnvelope<Eip4844>
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EthereumTxEnvelope<Eip4844>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EthereumTxEnvelope<Eip4844>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl<Eip4844> Encodable for EthereumTxEnvelope<Eip4844>where
EthereumTxEnvelope<Eip4844>: Encodable2718,
impl<Eip4844> Encodable for EthereumTxEnvelope<Eip4844>where
EthereumTxEnvelope<Eip4844>: Encodable2718,
§impl<Eip4844> Encodable2718 for EthereumTxEnvelope<Eip4844>
impl<Eip4844> Encodable2718 for EthereumTxEnvelope<Eip4844>
§fn encode_2718_len(&self) -> usize
fn encode_2718_len(&self) -> usize
§fn encode_2718(&self, out: &mut dyn BufMut)
fn encode_2718(&self, out: &mut dyn BufMut)
§fn trie_hash(&self) -> FixedBytes<32>
fn trie_hash(&self) -> FixedBytes<32>
§fn encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
§fn network_len(&self) -> usize
fn network_len(&self) -> usize
§fn network_encode(&self, out: &mut dyn BufMut)
fn network_encode(&self, out: &mut dyn BufMut)
§impl<T, Eip4844> From<Signed<T>> for EthereumTxEnvelope<Eip4844>where
EthereumTypedTransaction<Eip4844>: From<T>,
T: RlpEcdsaEncodableTx,
impl<T, Eip4844> From<Signed<T>> for EthereumTxEnvelope<Eip4844>where
EthereumTypedTransaction<Eip4844>: From<T>,
T: RlpEcdsaEncodableTx,
§impl<Eip4844> Hash for EthereumTxEnvelope<Eip4844>where
EthereumTxEnvelope<Eip4844>: Encodable2718,
impl<Eip4844> Hash for EthereumTxEnvelope<Eip4844>where
EthereumTxEnvelope<Eip4844>: Encodable2718,
§impl InMemorySize for EthereumTxEnvelope<TxEip4844WithSidecar>
impl InMemorySize for EthereumTxEnvelope<TxEip4844WithSidecar>
§impl<Eip4844> PartialEq for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaEncodableTx + PartialEq,
impl<Eip4844> PartialEq for EthereumTxEnvelope<Eip4844>where
Eip4844: RlpEcdsaEncodableTx + PartialEq,
§impl<Eip4844> Serialize for EthereumTxEnvelope<Eip4844>
impl<Eip4844> Serialize for EthereumTxEnvelope<Eip4844>
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
§impl SignedTransaction for EthereumTxEnvelope<TxEip4844WithSidecar>
impl SignedTransaction for EthereumTxEnvelope<TxEip4844WithSidecar>
§fn tx_hash(&self) -> &FixedBytes<32>
fn tx_hash(&self) -> &FixedBytes<32>
§fn signature(&self) -> &PrimitiveSignature
fn signature(&self) -> &PrimitiveSignature
§fn recover_signer(&self) -> Result<Address, RecoveryError>
fn recover_signer(&self) -> Result<Address, RecoveryError>
§fn recover_signer_unchecked_with_buf(
&self,
buf: &mut Vec<u8>,
) -> Result<Address, RecoveryError>
fn recover_signer_unchecked_with_buf( &self, buf: &mut Vec<u8>, ) -> Result<Address, RecoveryError>
Self::recover_signer_unchecked
but receives a buffer to operate on. This is used
during batch recovery to avoid allocating a new buffer for each transaction.§fn is_broadcastable_in_full(&self) -> bool
fn is_broadcastable_in_full(&self) -> bool
§fn try_recover(&self) -> Result<Address, RecoveryError>
fn try_recover(&self) -> Result<Address, RecoveryError>
§fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>
fn recover_signer_unchecked(&self) -> Result<Address, RecoveryError>
s
value. Read more§fn try_recover_unchecked(&self) -> Result<Address, RecoveryError>
fn try_recover_unchecked(&self) -> Result<Address, RecoveryError>
s
value. Read more§fn recalculate_hash(&self) -> FixedBytes<32>
fn recalculate_hash(&self) -> FixedBytes<32>
§fn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError>
fn try_clone_into_recovered(&self) -> Result<Recovered<Self>, RecoveryError>
Recovered
by cloning the type.§fn try_into_recovered(self) -> Result<Recovered<Self>, Self>
fn try_into_recovered(self) -> Result<Recovered<Self>, Self>
§fn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>
fn into_recovered_unchecked(self) -> Result<Recovered<Self>, RecoveryError>
§impl<Eip4844> Transaction for EthereumTxEnvelope<Eip4844>
impl<Eip4844> Transaction for EthereumTxEnvelope<Eip4844>
§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
§fn max_priority_fee_per_gas(&self) -> Option<u128>
fn max_priority_fee_per_gas(&self) -> Option<u128>
§fn max_fee_per_blob_gas(&self) -> Option<u128>
fn max_fee_per_blob_gas(&self) -> Option<u128>
§fn priority_fee_or_price(&self) -> u128
fn priority_fee_or_price(&self) -> u128
§fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
fn effective_gas_price(&self, base_fee: Option<u64>) -> u128
§fn is_dynamic_fee(&self) -> bool
fn is_dynamic_fee(&self) -> bool
true
if the transaction supports dynamic fees.§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.§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.§fn blob_versioned_hashes(&self) -> Option<&[FixedBytes<32>]>
fn blob_versioned_hashes(&self) -> Option<&[FixedBytes<32>]>
None
.SignedAuthorization
list of the transaction. Read more§fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
fn effective_tip_per_gas(&self, base_fee: u64) -> Option<u128>
§fn to(&self) -> Option<Address>
fn to(&self) -> Option<Address>
§fn function_selector(&self) -> Option<&FixedBytes<4>>
fn function_selector(&self) -> Option<&FixedBytes<4>>
§fn blob_count(&self) -> Option<u64>
fn blob_count(&self) -> Option<u64>
§fn blob_gas_used(&self) -> Option<u64>
fn blob_gas_used(&self) -> Option<u64>
SignedAuthorization
in this transactions Read more