we have extra helpers for deposit functions:
|
/// Returns the source hash of the transaction, which uniquely identifies its source. |
|
/// If not a deposit transaction, this will always return `None`. |
|
#[cfg(feature = "optimism")] |
|
pub const fn source_hash(&self) -> Option<B256> { |
|
match self { |
|
Self::Deposit(TxDeposit { source_hash, .. }) => Some(*source_hash), |
|
_ => None, |
|
} |
|
} |
|
|
|
/// Returns the amount of ETH locked up on L1 that will be minted on L2. If the transaction |
|
/// is not a deposit transaction, this will always return `None`. |
|
#[cfg(feature = "optimism")] |
|
pub const fn mint(&self) -> Option<u128> { |
|
match self { |
|
Self::Deposit(TxDeposit { mint, .. }) => *mint, |
|
_ => None, |
|
} |
|
} |
|
|
|
/// Returns whether or not the transaction is a system transaction. If the transaction |
|
/// is not a deposit transaction, this will always return `false`. |
|
#[cfg(feature = "optimism")] |
|
pub const fn is_system_transaction(&self) -> bool { |
|
match self { |
|
Self::Deposit(TxDeposit { is_system_transaction, .. }) => *is_system_transaction, |
|
_ => false, |
|
} |
|
} |
|
|
|
/// Returns whether or not the transaction is an Optimism Deposited transaction. |
|
#[cfg(feature = "optimism")] |
|
pub const fn is_deposit(&self) -> bool { |
|
matches!(self, Self::Deposit(_)) |
|
} |
these should be converted into a trait on https://github.com/alloy-rs/op-alloy and implemented on
https://github.com/alloy-rs/op-alloy/blob/56f636e8f624164fdea9c5356ee59b40af8f5e9d/crates/consensus/src/transaction/deposit.rs#L15-L15
we have extra helpers for deposit functions:
reth/crates/primitives/src/transaction/mod.rs
Lines 485 to 519 in 0b63972
these should be converted into a trait on https://github.com/alloy-rs/op-alloy and implemented on
https://github.com/alloy-rs/op-alloy/blob/56f636e8f624164fdea9c5356ee59b40af8f5e9d/crates/consensus/src/transaction/deposit.rs#L15-L15