Skip to content

Commit

Permalink
fix stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Aug 22, 2023
1 parent 0c550e4 commit 36ff482
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ pub struct Input {

impl Input {
pub fn get_blobs(&self) -> Result<Vec<Blob>, Error> {
self.blobs.iter().map(|blob| Blob::from_hex(blob)).collect()
// TODO: `iter.map.collect` overflows the stack
let mut v = Vec::with_capacity(self.blobs.len());
for blob in &self.blobs {
v.push(Blob::from_hex(blob)?);
}
Ok(v)
}

pub fn get_commitments(&self) -> Result<Vec<Bytes48>, Error> {
Expand Down

0 comments on commit 36ff482

Please sign in to comment.