fix: ensure no blob transactions in payloads pre-cancun (#4779)

This commit is contained in:
Dan Cline
2023-09-26 14:24:20 -04:00
committed by GitHub
parent 5e01a21ec4
commit eb6dc51971
5 changed files with 90 additions and 19 deletions

View File

@@ -60,6 +60,11 @@ impl Block {
BlockWithSenders { block: self, senders }
}
/// Returns whether or not the block contains any blob transactions.
pub fn has_blob_transactions(&self) -> bool {
self.body.iter().any(|tx| tx.is_eip4844())
}
/// Calculates a heuristic for the in-memory size of the [Block].
#[inline]
pub fn size(&self) -> usize {