Skip to content

Commit

Permalink
Fix bytes31 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGCalderon committed Oct 17, 2024
1 parent a2d0ec2 commit 751a549
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,13 @@ pub mod trace_dump {
_ => unreachable!(),
},
CoreTypeConcrete::Bytes31(_) => {
Value::Bytes31(Felt::from_bytes_le(value_ptr.cast().as_ref()))
let original_data: [u8; 31] = value_ptr.cast().read();
let mut data = [0u8; 32];
for (i, v) in original_data.into_iter().enumerate() {
data[i] = v
}

Value::Bytes31(Felt::from_bytes_le(&data))
}
}
}
Expand Down

0 comments on commit 751a549

Please sign in to comment.