diff --git a/crates/rpc/rpc-types/src/eth/engine/payload.rs b/crates/rpc/rpc-types/src/eth/engine/payload.rs index 316f760fbe..98a43d9f69 100644 --- a/crates/rpc/rpc-types/src/eth/engine/payload.rs +++ b/crates/rpc/rpc-types/src/eth/engine/payload.rs @@ -242,6 +242,21 @@ impl From> for BlobsBundleV1 { } } +impl BlobsBundleV1 { + /// Take `len` blob data from the bundle. + /// + /// # Panics + /// + /// If len is more than the blobs bundle len. + pub fn take(&mut self, len: usize) -> (Vec, Vec, Vec) { + ( + self.commitments.drain(0..len).collect(), + self.proofs.drain(0..len).collect(), + self.blobs.drain(0..len).collect(), + ) + } +} + /// An execution payload, which can be either [ExecutionPayloadV1], [ExecutionPayloadV2], or /// [ExecutionPayloadV3]. #[derive(Clone, Debug, PartialEq, Eq)]