Skip to content

Commit

Permalink
feat: add missing size fn
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Nov 22, 2024
1 parent 4b43094 commit 5aa5976
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/consensus/src/transaction/eip4844.rs
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,12 @@ impl TxEip4844WithSidecar {
pub fn into_parts(self) -> (TxEip4844, BlobTransactionSidecar) {
(self.tx, self.sidecar)
}

/// Calculates a heuristic for the in-memory size of the [TxEip4844WithSidecar] transaction.
#[inline]
pub fn size(&self) -> usize {
self.tx.size() + self.sidecar.size()
}
}

impl SignableTransaction<Signature> for TxEip4844WithSidecar {
Expand Down

0 comments on commit 5aa5976

Please sign in to comment.