pub struct OpTransaction<T: Transaction> {
pub base: T,
pub enveloped_tx: Option<Bytes>,
pub deposit: DepositTransactionParts,
}Expand description
Optimism transaction.
Fields§
§base: TBase transaction fields.
enveloped_tx: Option<Bytes>An enveloped EIP-2718 typed transaction
This is used to compute the L1 tx cost using the L1 block info, as opposed to requiring downstream apps to compute the cost externally.
deposit: DepositTransactionPartsDeposit transaction parts.
Implementations§
Source§impl<T: Transaction> OpTransaction<T>
impl<T: Transaction> OpTransaction<T>
Source§impl OpTransaction<TxEnv>
impl OpTransaction<TxEnv>
Sourcepub fn builder() -> OpTransactionBuilder
pub fn builder() -> OpTransactionBuilder
Create a new Optimism transaction.
Trait Implementations§
Source§impl<T: Transaction> AsRef<T> for OpTransaction<T>
impl<T: Transaction> AsRef<T> for OpTransaction<T>
Source§impl<T: Clone + Transaction> Clone for OpTransaction<T>
impl<T: Clone + Transaction> Clone for OpTransaction<T>
Source§fn clone(&self) -> OpTransaction<T>
fn clone(&self) -> OpTransaction<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Transaction> Debug for OpTransaction<T>
impl<T: Debug + Transaction> Debug for OpTransaction<T>
Source§impl Default for OpTransaction<TxEnv>
impl Default for OpTransaction<TxEnv>
Source§impl<'de, T> Deserialize<'de> for OpTransaction<T>where
T: Deserialize<'de> + Transaction,
impl<'de, T> Deserialize<'de> for OpTransaction<T>where
T: Deserialize<'de> + Transaction,
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<T: Transaction> OpTxTr for OpTransaction<T>
impl<T: Transaction> OpTxTr for OpTransaction<T>
Source§fn enveloped_tx(&self) -> Option<&Bytes>
fn enveloped_tx(&self) -> Option<&Bytes>
Enveloped transaction bytes.
Source§fn source_hash(&self) -> Option<B256>
fn source_hash(&self) -> Option<B256>
Source hash of the deposit transaction.
Source§fn is_system_transaction(&self) -> bool
fn is_system_transaction(&self) -> bool
Whether the transaction is a system transaction
Source§fn is_deposit(&self) -> bool
fn is_deposit(&self) -> bool
Returns
true if transaction is of type DEPOSIT_TRANSACTION_TYPE.Source§impl<T: PartialEq + Transaction> PartialEq for OpTransaction<T>
impl<T: PartialEq + Transaction> PartialEq for OpTransaction<T>
Source§impl<T> Serialize for OpTransaction<T>where
T: Serialize + Transaction,
impl<T> Serialize for OpTransaction<T>where
T: Serialize + Transaction,
Source§impl<TX: Transaction + SystemCallTx> SystemCallTx for OpTransaction<TX>
impl<TX: Transaction + SystemCallTx> SystemCallTx for OpTransaction<TX>
Source§fn new_system_tx_with_caller(
caller: Address,
system_contract_address: Address,
data: Bytes,
) -> Self
fn new_system_tx_with_caller( caller: Address, system_contract_address: Address, data: Bytes, ) -> Self
Creates a new system transaction with a custom caller address.
§fn new_system_tx(system_contract_address: Address, data: Bytes) -> Self
fn new_system_tx(system_contract_address: Address, data: Bytes) -> Self
Creates new transaction for system call.
Source§impl<T: Transaction> Transaction for OpTransaction<T>
impl<T: Transaction> Transaction for OpTransaction<T>
Source§type AccessListItem<'a> = <T as Transaction>::AccessListItem<'a>
where
T: 'a
type AccessListItem<'a> = <T as Transaction>::AccessListItem<'a> where T: 'a
EIP-2930 Access list item type.
Source§type Authorization<'a> = <T as Transaction>::Authorization<'a>
where
T: 'a
type Authorization<'a> = <T as Transaction>::Authorization<'a> where T: 'a
EIP-7702 Authorization type.
Source§fn access_list(&self) -> Option<impl Iterator<Item = Self::AccessListItem<'_>>>
fn access_list(&self) -> Option<impl Iterator<Item = Self::AccessListItem<'_>>>
Access list for the transaction. Read more
Source§fn max_priority_fee_per_gas(&self) -> Option<u128>
fn max_priority_fee_per_gas(&self) -> Option<u128>
Maximum priority fee per gas.
Source§fn max_fee_per_gas(&self) -> u128
fn max_fee_per_gas(&self) -> u128
Returns maximum fee that can be paid for the transaction.
Source§fn gas_price(&self) -> u128
fn gas_price(&self) -> u128
Gas price for the transaction.
It is only applicable for Legacy and EIP-2930 transactions.
For Eip1559 it is max_fee_per_gas.
Source§fn blob_versioned_hashes(&self) -> &[B256] ⓘ
fn blob_versioned_hashes(&self) -> &[B256] ⓘ
Returns vector of fixed size hash(32 bytes) Read more
Source§fn max_fee_per_blob_gas(&self) -> u128
fn max_fee_per_blob_gas(&self) -> u128
Max fee per data gas Read more
Source§fn effective_gas_price(&self, base_fee: u128) -> u128
fn effective_gas_price(&self, base_fee: u128) -> u128
Returns effective gas price is gas price field for Legacy and Eip2930 transaction. Read more
Returns length of the authorization list. Read more
List of authorizations, that contains the signature that authorizes this
caller to place the code to signer account. Read more
§fn total_blob_gas(&self) -> u64
fn total_blob_gas(&self) -> u64
Total gas for all blobs. Max number of blocks is already checked
so we dont need to check for overflow.
§fn calc_max_data_fee(&self) -> Uint<256, 4>
fn calc_max_data_fee(&self) -> Uint<256, 4>
Calculates the maximum [EIP-4844]
data_fee of the transaction. Read more§fn max_balance_spending(&self) -> Result<Uint<256, 4>, InvalidTransaction>
fn max_balance_spending(&self) -> Result<Uint<256, 4>, InvalidTransaction>
Returns the maximum balance that can be spent by the transaction. Read more
§fn ensure_enough_balance(
&self,
balance: Uint<256, 4>,
) -> Result<(), InvalidTransaction>
fn ensure_enough_balance( &self, balance: Uint<256, 4>, ) -> Result<(), InvalidTransaction>
Checks if the caller has enough balance to cover the maximum balance spending of this transaction. Read more
impl<T: Eq + Transaction> Eq for OpTransaction<T>
impl<T: Transaction> StructuralPartialEq for OpTransaction<T>
Auto Trait Implementations§
impl<T> !Freeze for OpTransaction<T>
impl<T> RefUnwindSafe for OpTransaction<T>where
T: RefUnwindSafe,
impl<T> Send for OpTransaction<T>where
T: Send,
impl<T> Sync for OpTransaction<T>where
T: Sync,
impl<T> Unpin for OpTransaction<T>where
T: Unpin,
impl<T> UnwindSafe for OpTransaction<T>where
T: UnwindSafe,
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,
§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
Compare self to
key and return true if they are equal.§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
Checks if this value is equivalent to the given key. Read more
§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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Causes
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,
Formats each item in a sequence. Read more
§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>
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§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,
Pipes by value. This is generally the method you want to use. Read more
§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,
Borrows
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,
Mutably borrows
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
Borrows
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
Mutably borrows
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
Borrows
self, then passes self.deref() into the pipe function.§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Immutable access to the
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
Mutable access to the
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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.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
Calls
.tap_deref() only in debug builds, and is erased in release
builds.