Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions crates/eips/src/eip7594/sidecar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,22 @@ impl BlobTransactionSidecarVariant {
}
}

/// Get a reference to the blobs
pub fn blobs(&self) -> &[Blob] {
match self {
Self::Eip4844(sidecar) => &sidecar.blobs,
Self::Eip7594(sidecar) => &sidecar.blobs,
}
}

/// Consume self and return the blobs
pub fn into_blobs(self) -> Vec<Blob> {
match self {
Self::Eip4844(sidecar) => sidecar.blobs,
Self::Eip7594(sidecar) => sidecar.blobs,
}
}

/// Calculates a size heuristic for the in-memory size of the [BlobTransactionSidecarVariant].
#[inline]
pub fn size(&self) -> usize {
Expand Down