Enum OpTypedTransaction
pub enum OpTypedTransaction {
Legacy(TxLegacy),
Eip2930(TxEip2930),
Eip1559(TxEip1559),
Eip7702(TxEip7702),
Deposit(TxDeposit),
}
Expand description
The TypedTransaction enum represents all Ethereum transaction request types, modified for the OP Stack.
Its variants correspond to specific allowed transactions:
- Legacy (pre-EIP2718) [
TxLegacy
] - EIP2930 (state access lists) [
TxEip2930
] - EIP1559 [
TxEip1559
] - Deposit [
TxDeposit
]
Variants§
Legacy(TxLegacy)
Legacy transaction
Eip2930(TxEip2930)
EIP-2930 transaction
Eip1559(TxEip1559)
EIP-1559 transaction
Eip7702(TxEip7702)
EIP-7702 transaction
Deposit(TxDeposit)
Optimism deposit transaction
Implementations§
§impl OpTypedTransaction
impl OpTypedTransaction
pub fn checked_signature_hash(&self) -> Option<FixedBytes<32>>
pub fn checked_signature_hash(&self) -> Option<FixedBytes<32>>
Calculates the signing hash for the transaction.
Returns None
if the tx is a deposit transaction.
pub const fn eip2930(&self) -> Option<&TxEip2930>
pub const fn eip2930(&self) -> Option<&TxEip2930>
Return the inner EIP-2930 transaction if it exists.
pub const fn eip1559(&self) -> Option<&TxEip1559>
pub const fn eip1559(&self) -> Option<&TxEip1559>
Return the inner EIP-1559 transaction if it exists.
pub const fn is_deposit(&self) -> bool
pub const fn is_deposit(&self) -> bool
Returns true
if transaction is deposit transaction.
pub fn tx_hash(&self, signature: &Signature) -> FixedBytes<32>
pub fn tx_hash(&self, signature: &Signature) -> FixedBytes<32>
Calculate the transaction hash for the given signature.
Note: Returns the regular tx hash if this is a deposit variant
Trait Implementations§
§impl<'arbitrary> Arbitrary<'arbitrary> for OpTypedTransaction
impl<'arbitrary> Arbitrary<'arbitrary> for OpTypedTransaction
§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<OpTypedTransaction, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<OpTypedTransaction, Error>
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<OpTypedTransaction, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<OpTypedTransaction, Error>
Self
from the entirety of the given
unstructured data. Read more§impl Clone for OpTypedTransaction
impl Clone for OpTypedTransaction
§fn clone(&self) -> OpTypedTransaction
fn clone(&self) -> OpTypedTransaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Compact for OpTypedTransaction
impl Compact for OpTypedTransaction
§fn to_compact<B>(&self, out: &mut B) -> usize
fn to_compact<B>(&self, out: &mut B) -> usize
§fn from_compact(buf: &[u8], identifier: usize) -> (OpTypedTransaction, &[u8])
fn from_compact(buf: &[u8], identifier: usize) -> (OpTypedTransaction, &[u8])
buf
with its internal cursor
advanced (eg..advance(len)
). Read more§fn specialized_to_compact<B>(&self, buf: &mut B) -> usize
fn specialized_to_compact<B>(&self, buf: &mut B) -> usize
§fn specialized_from_compact(buf: &[u8], len: usize) -> (Self, &[u8])
fn specialized_from_compact(buf: &[u8], len: usize) -> (Self, &[u8])
§impl Debug for OpTypedTransaction
impl Debug for OpTypedTransaction
§impl<'de> Deserialize<'de> for OpTypedTransaction
impl<'de> Deserialize<'de> for OpTypedTransaction
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpTypedTransaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<OpTypedTransaction, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<MaybeTaggedTypedTransaction> for OpTypedTransaction
impl From<MaybeTaggedTypedTransaction> for OpTypedTransaction
§fn from(value: MaybeTaggedTypedTransaction) -> OpTypedTransaction
fn from(value: MaybeTaggedTypedTransaction) -> OpTypedTransaction
§impl From<OpTxEnvelope> for OpTypedTransaction
impl From<OpTxEnvelope> for OpTypedTransaction
§fn from(envelope: OpTxEnvelope) -> OpTypedTransaction
fn from(envelope: OpTxEnvelope) -> OpTypedTransaction
§impl From<TaggedTypedTransaction> for OpTypedTransaction
impl From<TaggedTypedTransaction> for OpTypedTransaction
§fn from(value: TaggedTypedTransaction) -> OpTypedTransaction
fn from(value: TaggedTypedTransaction) -> OpTypedTransaction
§impl From<TxDeposit> for OpTypedTransaction
impl From<TxDeposit> for OpTypedTransaction
§fn from(tx: TxDeposit) -> OpTypedTransaction
fn from(tx: TxDeposit) -> OpTypedTransaction
§impl From<TxEip1559> for OpTypedTransaction
impl From<TxEip1559> for OpTypedTransaction
§fn from(tx: TxEip1559) -> OpTypedTransaction
fn from(tx: TxEip1559) -> OpTypedTransaction
§impl From<TxEip2930> for OpTypedTransaction
impl From<TxEip2930> for OpTypedTransaction
§fn from(tx: TxEip2930) -> OpTypedTransaction
fn from(tx: TxEip2930) -> OpTypedTransaction
§impl From<TxEip7702> for OpTypedTransaction
impl From<TxEip7702> for OpTypedTransaction
§fn from(tx: TxEip7702) -> OpTypedTransaction
fn from(tx: TxEip7702) -> OpTypedTransaction
§impl From<TxLegacy> for OpTypedTransaction
impl From<TxLegacy> for OpTypedTransaction
§fn from(tx: TxLegacy) -> OpTypedTransaction
fn from(tx: TxLegacy) -> OpTypedTransaction
§impl Hash for OpTypedTransaction
impl Hash for OpTypedTransaction
§impl InMemorySize for OpTypedTransaction
impl InMemorySize for OpTypedTransaction
§impl IsTyped2718 for OpTypedTransaction
impl IsTyped2718 for OpTypedTransaction
§impl PartialEq for OpTypedTransaction
impl PartialEq for OpTypedTransaction
§impl Serialize for OpTypedTransaction
impl Serialize for OpTypedTransaction
§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 SignableTransaction<Signature> for OpTypedTransaction
impl SignableTransaction<Signature> for OpTypedTransaction
§fn set_chain_id(&mut self, chain_id: u64)
fn set_chain_id(&mut self, chain_id: u64)
chain_id
. Read more§fn encode_for_signing(&self, out: &mut dyn BufMut)
fn encode_for_signing(&self, out: &mut dyn BufMut)
§fn payload_len_for_signature(&self) -> usize
fn payload_len_for_signature(&self) -> usize
§fn into_signed(self, signature: Signature) -> Signed<OpTypedTransaction>where
OpTypedTransaction: Sized,
fn into_signed(self, signature: Signature) -> Signed<OpTypedTransaction>where
OpTypedTransaction: Sized,
Signed
] object.§fn set_chain_id_checked(&mut self, chain_id: u64) -> bool
fn set_chain_id_checked(&mut self, chain_id: u64) -> bool
chain_id
if it is not already set. Checks that the provided chain_id
matches the
existing chain_id
if it is already set, returning false
if they do not match.§fn encoded_for_signing(&self) -> Vec<u8> ⓘ
fn encoded_for_signing(&self) -> Vec<u8> ⓘ
signature_hash
. Read more§fn signature_hash(&self) -> FixedBytes<32>
fn signature_hash(&self) -> FixedBytes<32>
§impl Transaction for OpTypedTransaction
impl Transaction for OpTypedTransaction
§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 to(&self) -> Option<Address>
fn to(&self) -> Option<Address>
§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 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§impl Typed2718 for OpTypedTransaction
impl Typed2718 for OpTypedTransaction
§fn is_eip2930(&self) -> bool
fn is_eip2930(&self) -> bool
§fn is_eip1559(&self) -> bool
fn is_eip1559(&self) -> bool
§fn is_eip4844(&self) -> bool
fn is_eip4844(&self) -> bool
§fn is_eip7702(&self) -> bool
fn is_eip7702(&self) -> bool
impl Eq for OpTypedTransaction
impl StructuralPartialEq for OpTypedTransaction
Auto Trait Implementations§
impl !Freeze for OpTypedTransaction
impl RefUnwindSafe for OpTypedTransaction
impl Send for OpTypedTransaction
impl Sync for OpTypedTransaction
impl Unpin for OpTypedTransaction
impl UnwindSafe for OpTypedTransaction
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,
§impl<T> Conv for T
impl<T> Conv for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.§impl<T> TryConv for T
impl<T> TryConv for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<A> ArbInterop for A
impl<'de, T> BorrowedRpcObject<'de> for Twhere
T: RpcBorrow<'de> + RpcSend,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> FullTransaction for Twhere
T: Transaction + MaybeCompact,
impl<T> MaybeCompact for Twhere
T: Compact,
impl<T> MaybeSend for Twhere
T: Send,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<'de, T> RpcBorrow<'de> for T
impl<T> RpcObject for Twhere
T: RpcSend + RpcRecv,
impl<T> RpcRecv for T
impl<T> RpcSend for T
impl<T> Transaction for T
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: 208 bytes
Size for each variant:
Legacy
: 144 bytesEip2930
: 160 bytesEip1559
: 176 bytesEip7702
: 192 bytesDeposit
: 192 bytes