Skip to content

Commit

Permalink
fix: serialize sequence hint (#892)
Browse files Browse the repository at this point in the history
Closes #891
  • Loading branch information
enitrat authored Feb 28, 2025
1 parent d0a738e commit 2088b44
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/cairo-addons/src/vm/hint_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ pub fn serialize_sequence(
let len =
len_felt.try_into().map_err(|_| MathError::Felt252ToUsizeConversion(Box::new(len_felt)))?;

// if len == 0 then no memory is allocated for the sequence
if len == 0 {
return Ok(vec![]);
}

let data = vm.get_relocatable(ptr)?;

let values = (0..len)
Expand Down

0 comments on commit 2088b44

Please sign in to comment.