From 5f39f42cee8835d8874dbdf2be73413492ef0053 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 1 Aug 2024 19:19:01 +0200 Subject: [PATCH] feat: add has eip7702 transactions (#9996) --- crates/primitives/src/block.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/primitives/src/block.rs b/crates/primitives/src/block.rs index f646449209..1d2482cb70 100644 --- a/crates/primitives/src/block.rs +++ b/crates/primitives/src/block.rs @@ -133,6 +133,12 @@ impl Block { self.body.iter().any(|tx| tx.is_eip4844()) } + /// Returns whether or not the block contains any EIP-7702 transactions. + #[inline] + pub fn has_eip7702_transactions(&self) -> bool { + self.body.iter().any(|tx| tx.is_eip7702()) + } + /// Returns an iterator over all blob transactions of the block #[inline] pub fn blob_transactions_iter(&self) -> impl Iterator + '_ { @@ -439,6 +445,12 @@ impl SealedBlock { self.body.iter().any(|tx| tx.is_eip4844()) } + /// Returns whether or not the block contains any eip-7702 transactions. + #[inline] + pub fn has_eip7702_transactions(&self) -> bool { + self.body.iter().any(|tx| tx.is_eip7702()) + } + /// Ensures that the transaction root in the block header is valid. /// /// The transaction root is the Keccak 256-bit hash of the root node of the trie structure