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 rlp_decode_fields(buf: &mut &[u8]) -> Result<Self>
pub fn rlp_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 fn rlp_decode(buf: &mut &[u8]) -> Result<Self>
pub fn rlp_decode(buf: &mut &[u8]) -> Result<Self>
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 eip2718_encode(&self, out: &mut dyn BufMut)
pub fn eip2718_encode(&self, out: &mut dyn BufMut)
EIP-2718 encode the transaction with the given signature and the default type flag.
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.
Trait Implementations§
Source§impl DepositTransaction for TxDeposit
impl DepositTransaction for TxDeposit
Source§fn source_hash(&self) -> Option<B256>
fn source_hash(&self) -> Option<B256>
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 From<TxDeposit> for OpTxEnvelope
impl From<TxDeposit> for OpTxEnvelope
Source§impl From<TxDeposit> for OpTypedTransaction
impl From<TxDeposit> for OpTypedTransaction
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
)