feat: add has eip7702 transactions (#9996)

This commit is contained in:
Matthias Seitz
2024-08-01 19:19:01 +02:00
committed by GitHub
parent 333dbdeda2
commit 5f39f42cee

View File

@ -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<Item = &TransactionSigned> + '_ {
@ -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