pub enum OpPooledTransaction {
Legacy(Signed<TxLegacy>),
Eip2930(Signed<TxEip2930>),
Eip1559(Signed<TxEip1559>),
Eip7702(Signed<TxEip7702>),
}
consensus
only.Expand description
All possible transactions that can be included in a response to GetPooledTransactions
.
A response to GetPooledTransactions
. This can include a typed signed transaction, but cannot
include a deposit transaction or EIP-4844 transaction.
The difference between this and the OpTxEnvelope
is that this type does not have the deposit
transaction variant, which is not expected to be pooled.
Variants§
Legacy(Signed<TxLegacy>)
An untagged TxLegacy
.
Eip2930(Signed<TxEip2930>)
A TxEip2930
transaction tagged with type 1.
Eip1559(Signed<TxEip1559>)
A TxEip1559
transaction tagged with type 2.
Eip7702(Signed<TxEip7702>)
A TxEip7702
transaction tagged with type 4.
Implementations§
Source§impl OpPooledTransaction
impl OpPooledTransaction
Sourcepub fn signature_hash(&self) -> FixedBytes<32>
pub fn signature_hash(&self) -> FixedBytes<32>
Heavy operation that returns the signature hash over rlp encoded transaction. It is only for signature signing or signer recovery.
Sourcepub const fn hash(&self) -> &FixedBytes<32>
pub const fn hash(&self) -> &FixedBytes<32>
Reference to transaction hash. Used to identify transaction.
Sourcepub const fn signature(&self) -> &PrimitiveSignature
pub const fn signature(&self) -> &PrimitiveSignature
Returns the signature of the transaction.
Sourcepub fn recover_signer(&self) -> Result<Address, SignatureError>
Available on crate feature k256
only.
pub fn recover_signer(&self) -> Result<Address, SignatureError>
k256
only.Recover the signer of the 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 the ethereum TxEnvelope
.
Sourcepub fn into_op_envelope(self) -> OpTxEnvelope
pub fn into_op_envelope(self) -> OpTxEnvelope
Converts the transaction into the optimism OpTxEnvelope
.
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_eip7702(&self) -> Option<&TxEip7702>
pub const fn as_eip7702(&self) -> Option<&TxEip7702>
Returns the TxEip7702
variant if the transaction is an EIP-7702 transaction.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for OpPooledTransaction
impl<'arbitrary> Arbitrary<'arbitrary> for OpPooledTransaction
Source§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<OpPooledTransaction, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<OpPooledTransaction, Error>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<OpPooledTransaction, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<OpPooledTransaction, Error>
Self
from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured
this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured
this type
needs to construct itself. Read moreSource§impl Clone for OpPooledTransaction
impl Clone for OpPooledTransaction
Source§fn clone(&self) -> OpPooledTransaction
fn clone(&self) -> OpPooledTransaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for OpPooledTransaction
impl Debug for OpPooledTransaction
Source§impl Decodable for OpPooledTransaction
impl Decodable for OpPooledTransaction
Source§fn decode(buf: &mut &[u8]) -> Result<OpPooledTransaction, Error>
fn decode(buf: &mut &[u8]) -> Result<OpPooledTransaction, Error>
Decodes an enveloped OpPooledTransaction
.
CAUTION: this expects that buf
is rlp(tx_type || rlp(tx-data))
Source§impl Decodable2718 for OpPooledTransaction
impl Decodable2718 for OpPooledTransaction
Source§fn typed_decode(
ty: u8,
buf: &mut &[u8],
) -> Result<OpPooledTransaction, Eip2718Error>
fn typed_decode( ty: u8, buf: &mut &[u8], ) -> Result<OpPooledTransaction, Eip2718Error>
Source§fn fallback_decode(buf: &mut &[u8]) -> Result<OpPooledTransaction, Eip2718Error>
fn fallback_decode(buf: &mut &[u8]) -> Result<OpPooledTransaction, Eip2718Error>
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 OpPooledTransaction
impl<'de> Deserialize<'de> for OpPooledTransaction
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpPooledTransaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpPooledTransaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Encodable for OpPooledTransaction
impl Encodable for OpPooledTransaction
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 OpPooledTransaction
impl Encodable2718 for OpPooledTransaction
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) -> FixedBytes<32>
fn trie_hash(&self) -> FixedBytes<32>
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<OpPooledTransaction> for OpTxEnvelope
impl From<OpPooledTransaction> for OpTxEnvelope
Source§fn from(tx: OpPooledTransaction) -> OpTxEnvelope
fn from(tx: OpPooledTransaction) -> OpTxEnvelope
Source§impl Hash for OpPooledTransaction
impl Hash for OpPooledTransaction
Source§impl PartialEq for OpPooledTransaction
impl PartialEq for OpPooledTransaction
Source§impl Serialize for OpPooledTransaction
impl Serialize for OpPooledTransaction
Source§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,
Source§impl Transaction for OpPooledTransaction
impl Transaction for OpPooledTransaction
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<&[FixedBytes<32>]>
fn blob_versioned_hashes(&self) -> Option<&[FixedBytes<32>]>
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 OpPooledTransaction
impl Typed2718 for OpPooledTransaction
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 OpPooledTransaction
impl StructuralPartialEq for OpPooledTransaction
Auto Trait Implementations§
impl !Freeze for OpPooledTransaction
impl RefUnwindSafe for OpPooledTransaction
impl Send for OpPooledTransaction
impl Sync for OpPooledTransaction
impl Unpin for OpPooledTransaction
impl UnwindSafe for OpPooledTransaction
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§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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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>
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