pub struct TxDeposit {
pub source_hash: B256,
pub from: Address,
pub to: TxKind,
pub mint: Option<u128>,
pub value: U256,
pub gas_limit: u64,
pub is_system_transaction: bool,
pub input: Bytes,
}
Expand description
Deposit transactions, also known as deposits are initiated on L1, and executed on L2.
Fields§
§source_hash: B256
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: U256
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 decode_fields(buf: &mut &[u8]) -> Result<Self>
pub fn decode_fields(buf: &mut &[u8]) -> Result<Self>
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(crate) fn fields_len(&self) -> usize
pub(crate) fn fields_len(&self) -> usize
Outputs the length of the transaction’s fields, without a RLP header or length of the eip155 fields.
sourcepub(crate) fn encode_fields(&self, out: &mut dyn BufMut)
pub(crate) fn encode_fields(&self, out: &mut dyn BufMut)
Encodes only the transaction’s fields into the desired buffer, without a RLP header. https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/deposits.md#the-deposited-transaction-type
sourcepub fn size(&self) -> usize
pub fn size(&self) -> usize
Calculates a heuristic for the in-memory size of the TxDeposit transaction.
sourcepub fn encode_inner(&self, out: &mut dyn BufMut, with_header: bool)
pub fn encode_inner(&self, out: &mut dyn BufMut, with_header: bool)
Inner encoding function that is used for both rlp [Encodable
] trait and for calculating
hash that for eip2718 does not require rlp header
sourcepub fn encoded_len(&self, with_header: bool) -> usize
pub fn encoded_len(&self, with_header: bool) -> usize
Output the length of the RLP signed transaction encoding.
If with_header
is true, the length includes the RLP header.
Trait Implementations§
source§impl<'arbitrary> Arbitrary<'arbitrary> for TxDeposit
impl<'arbitrary> Arbitrary<'arbitrary> for TxDeposit
source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self
from the given unstructured data. Read moresource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self
from the entirety of the given
unstructured data. Read moresource§impl<'de> Deserialize<'de> for TxDeposit
impl<'de> Deserialize<'de> for TxDeposit
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>,
source§impl<'de> DeserializeAs<'de, TxDeposit> for TxDeposit<'de>
Available on crate features serde
and serde-bincode-compat
only.
impl<'de> DeserializeAs<'de, TxDeposit> for TxDeposit<'de>
serde
and serde-bincode-compat
only.source§fn deserialize_as<D>(deserializer: D) -> Result<TxDeposit, D::Error>where
D: Deserializer<'de>,
fn deserialize_as<D>(deserializer: D) -> Result<TxDeposit, D::Error>where
D: Deserializer<'de>,
source§impl<'a> From<&'a TxDeposit> for TxDeposit<'a>
Available on crate features serde
and serde-bincode-compat
only.
impl<'a> From<&'a TxDeposit> for TxDeposit<'a>
serde
and serde-bincode-compat
only.source§impl<'a> From<TxDeposit<'a>> for TxDeposit
Available on crate features serde
and serde-bincode-compat
only.
impl<'a> From<TxDeposit<'a>> for TxDeposit
serde
and serde-bincode-compat
only.source§impl From<TxDeposit> for OpTxEnvelope
impl From<TxDeposit> for OpTxEnvelope
source§impl From<TxDeposit> for OpTypedTransaction
impl From<TxDeposit> for OpTypedTransaction
source§impl<'a> SerializeAs<TxDeposit> for TxDeposit<'a>
Available on crate features serde
and serde-bincode-compat
only.
impl<'a> SerializeAs<TxDeposit> for TxDeposit<'a>
serde
and serde-bincode-compat
only.source§fn serialize_as<S>(source: &TxDeposit, serializer: S) -> Result<S::Ok, S::Error>where
S: Serializer,
fn serialize_as<S>(source: &TxDeposit, serializer: S) -> Result<S::Ok, S::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 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<&[B256]>
fn blob_versioned_hashes(&self) -> Option<&[B256]>
None
.SignedAuthorization
] list of the transaction. Read moreimpl 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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: 192 bytes