Skip to content

Commit e7ba933

Browse files
authored
fix: reduce stack for blob helpers (#2161)
1 parent 9a34241 commit e7ba933

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

crates/eips/src/eip4844/sidecar.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,11 @@ impl BlobTransactionSidecar {
312312
I: IntoIterator<Item = B>,
313313
B: AsRef<str>,
314314
{
315-
let blobs = blobs
316-
.into_iter()
317-
.map(|blob| c_kzg::Blob::from_hex(blob.as_ref()))
318-
.collect::<Result<Vec<_>, _>>()?;
319-
Self::try_from_blobs(blobs)
315+
let mut b = Vec::new();
316+
for blob in blobs {
317+
b.push(c_kzg::Blob::from_hex(blob.as_ref())?)
318+
}
319+
Self::try_from_blobs(b)
320320
}
321321

322322
/// Tries to create a new [`BlobTransactionSidecar`] from the given blob bytes.
@@ -328,11 +328,11 @@ impl BlobTransactionSidecar {
328328
I: IntoIterator<Item = B>,
329329
B: AsRef<[u8]>,
330330
{
331-
let blobs = blobs
332-
.into_iter()
333-
.map(|blob| c_kzg::Blob::from_bytes(blob.as_ref()))
334-
.collect::<Result<Vec<_>, _>>()?;
335-
Self::try_from_blobs(blobs)
331+
let mut b = Vec::new();
332+
for blob in blobs {
333+
b.push(c_kzg::Blob::from_bytes(blob.as_ref())?)
334+
}
335+
Self::try_from_blobs(b)
336336
}
337337

338338
/// Tries to create a new [`BlobTransactionSidecar`] from the given blobs.

0 commit comments

Comments
 (0)