mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
add has_access_list method to TxType (#6153)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@ -44,6 +44,18 @@ pub enum TxType {
|
||||
DEPOSIT = 126_isize,
|
||||
}
|
||||
|
||||
impl TxType {
|
||||
/// Check if the transaction type has an access list.
|
||||
pub const fn has_access_list(&self) -> bool {
|
||||
match self {
|
||||
TxType::Legacy => false,
|
||||
TxType::EIP2930 | TxType::EIP1559 | TxType::EIP4844 => true,
|
||||
#[cfg(feature = "optimism")]
|
||||
TxType::DEPOSIT => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<TxType> for u8 {
|
||||
fn from(value: TxType) -> Self {
|
||||
match value {
|
||||
|
||||
Reference in New Issue
Block a user