pub struct TxDeposit {
pub source_hash: FixedBytes<32>,
pub from: Address,
pub to: TxKind,
pub mint: Option<u128>,
pub value: Uint<256, 4>,
pub gas_limit: u64,
pub is_system_transaction: bool,
pub input: Bytes,
}
consensus
only.Expand description
Deposit transactions, also known as deposits are initiated on L1, and executed on L2.
Fields§
§source_hash: FixedBytes<32>
Hash that uniquely identifies the source of the deposit.
from: Address
The address of the sender account.
to: TxKind
The address of the recipient account, or the null (zero-length) address if the deposited transaction is a contract creation.
mint: Option<u128>
The ETH value to mint on L2.
value: Uint<256, 4>
The ETH value to send to the recipient account.
gas_limit: u64
The gas limit for the L2 transaction.
is_system_transaction: bool
Field indicating if this transaction is exempt from the L2 gas limit.
input: Bytes
Input has two uses depending if transaction is Create or Call (if to
field is None or
Some).
Implementations§
Source§impl TxDeposit
impl TxDeposit
Sourcepub fn rlp_decode_fields(buf: &mut &[u8]) -> Result<TxDeposit, Error>
pub fn rlp_decode_fields(buf: &mut &[u8]) -> Result<TxDeposit, Error>
Decodes the inner TxDeposit fields from RLP bytes.
NOTE: This assumes a RLP header has already been decoded, and just decodes the following RLP fields in the following order:
source_hash
from
to
mint
value
gas_limit
is_system_transaction
input
Sourcepub fn rlp_decode(buf: &mut &[u8]) -> Result<TxDeposit, Error>
pub fn rlp_decode(buf: &mut &[u8]) -> Result<TxDeposit, Error>
Decodes the transaction from RLP bytes.
Sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Calculates a heuristic for the in-memory size of the TxDeposit transaction.
Sourcepub fn rlp_encode(&self, out: &mut dyn BufMut)
pub fn rlp_encode(&self, out: &mut dyn BufMut)
RLP encodes the transaction.
Sourcepub fn rlp_encoded_length(&self) -> usize
pub fn rlp_encoded_length(&self) -> usize
Get the length of the transaction when RLP encoded.
Sourcepub fn eip2718_encoded_length(&self) -> usize
pub fn eip2718_encoded_length(&self) -> usize
Get the length of the transaction when EIP-2718 encoded. This is the 1 byte type flag + the length of the RLP encoded transaction.
Sourcepub fn network_encoded_length(&self) -> usize
pub fn network_encoded_length(&self) -> usize
Get the length of the transaction when network encoded. This is the EIP-2718 encoded length with an outer RLP header.
Sourcepub fn network_encode(&self, out: &mut dyn BufMut)
pub fn network_encode(&self, out: &mut dyn BufMut)
Network encode the transaction with the given signature.
Sourcepub fn tx_hash(&self) -> FixedBytes<32>
pub fn tx_hash(&self) -> FixedBytes<32>
Calculate the transaction hash.
Sourcepub fn signature() -> PrimitiveSignature
pub fn signature() -> PrimitiveSignature
Returns the signature for the optimism deposit transactions, which don’t include a signature.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for TxDeposit
impl<'arbitrary> Arbitrary<'arbitrary> for TxDeposit
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<TxDeposit, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<TxDeposit, Error>
Self
from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<TxDeposit, Error>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<TxDeposit, 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 Decodable2718 for TxDeposit
impl Decodable2718 for TxDeposit
Source§fn typed_decode(ty: u8, data: &mut &[u8]) -> Result<TxDeposit, Eip2718Error>
fn typed_decode(ty: u8, data: &mut &[u8]) -> Result<TxDeposit, Eip2718Error>
Source§fn fallback_decode(data: &mut &[u8]) -> Result<TxDeposit, Eip2718Error>
fn fallback_decode(data: &mut &[u8]) -> Result<TxDeposit, 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 DepositTransaction for TxDeposit
impl DepositTransaction for TxDeposit
Source§fn source_hash(&self) -> Option<FixedBytes<32>>
fn source_hash(&self) -> Option<FixedBytes<32>>
Source§fn mint(&self) -> Option<u128>
fn mint(&self) -> Option<u128>
Source§fn is_system_transaction(&self) -> bool
fn is_system_transaction(&self) -> bool
Source§fn is_deposit(&self) -> bool
fn is_deposit(&self) -> bool
Source§impl<'de> Deserialize<'de> for TxDeposit
impl<'de> Deserialize<'de> for TxDeposit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TxDeposit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TxDeposit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Encodable2718 for TxDeposit
impl Encodable2718 for TxDeposit
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 encoded_2718(&self) -> Vec<u8> ⓘ
fn encoded_2718(&self) -> Vec<u8> ⓘ
Source§fn trie_hash(&self) -> FixedBytes<32>
fn trie_hash(&self) -> FixedBytes<32>
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<TxDeposit> for OpTransactionRequest
impl From<TxDeposit> for OpTransactionRequest
Source§fn from(tx: TxDeposit) -> OpTransactionRequest
fn from(tx: TxDeposit) -> OpTransactionRequest
Source§impl From<TxDeposit> for OpTxEnvelope
impl From<TxDeposit> for OpTxEnvelope
Source§fn from(v: TxDeposit) -> OpTxEnvelope
fn from(v: TxDeposit) -> OpTxEnvelope
Source§impl From<TxDeposit> for OpTypedTransaction
impl From<TxDeposit> for OpTypedTransaction
Source§fn from(tx: TxDeposit) -> OpTypedTransaction
fn from(tx: TxDeposit) -> OpTypedTransaction
Source§impl Sealable for TxDeposit
impl Sealable for TxDeposit
Source§fn hash_slow(&self) -> FixedBytes<32>
fn hash_slow(&self) -> FixedBytes<32>
Source§fn seal_ref_slow(&self) -> Sealed<&Self>
fn seal_ref_slow(&self) -> Sealed<&Self>
Source§fn seal_unchecked(self, seal: FixedBytes<32>) -> Sealed<Self>
fn seal_unchecked(self, seal: FixedBytes<32>) -> Sealed<Self>
Source§fn seal_ref_unchecked(&self, seal: FixedBytes<32>) -> Sealed<&Self>
fn seal_ref_unchecked(&self, seal: FixedBytes<32>) -> Sealed<&Self>
Source§impl Serialize for TxDeposit
impl Serialize for TxDeposit
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 TxDeposit
impl Transaction for TxDeposit
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, _: Option<u64>) -> u128
fn effective_gas_price(&self, _: 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 TxDeposit
impl Typed2718 for TxDeposit
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 TxDeposit
impl StructuralPartialEq for TxDeposit
Auto Trait Implementations§
impl !Freeze for TxDeposit
impl RefUnwindSafe for TxDeposit
impl Send for TxDeposit
impl Sync for TxDeposit
impl Unpin for TxDeposit
impl UnwindSafe for TxDeposit
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