diff --git a/crates/primitives/src/transaction/tx_type.rs b/crates/primitives/src/transaction/tx_type.rs index 8154fe8b1e..579853a008 100644 --- a/crates/primitives/src/transaction/tx_type.rs +++ b/crates/primitives/src/transaction/tx_type.rs @@ -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 for u8 { fn from(value: TxType) -> Self { match value {