Skip to content

Commit

Permalink
Changed debug::print to print hex values
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvalsw committed May 30, 2023
1 parent 5134920 commit 5fc8c35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/cairo-lang-casm/src/hints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ impl Display for CoreHint {
curr = {}
end = {}
while curr != end:
print(memory[curr])
print(hex(memory[curr]))
curr += 1
",
ResOperandFormatter(start),
Expand Down
2 changes: 1 addition & 1 deletion crates/cairo-lang-casm/src/hints/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fn test_debug_hint_format() {
curr = memory[ap + 6]
end = memory[fp + -8]
while curr != end:
print(memory[curr])
print(hex(memory[curr]))
curr += 1
"}
);
Expand Down
4 changes: 2 additions & 2 deletions crates/cairo-lang-runner/src/casm_run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1533,9 +1533,9 @@ pub fn execute_core_hint(
while curr != end {
let value = vm.get_integer(curr)?;
if let Some(shortstring) = as_cairo_short_string(&value) {
println!("[DEBUG]\t{shortstring: <31}\t(raw: {value: <31})");
println!("[DEBUG]\t{shortstring: <31}\t(raw: 0x{:X})", value.to_bigint());
} else {
println!("[DEBUG]\t{0: <31}\t(raw: {value: <31}) ", ' ');
println!("[DEBUG]\t{:<31}\t(raw: 0x{:X}) ", ' ', value.to_bigint());
}
curr += 1;
}
Expand Down

0 comments on commit 5fc8c35

Please sign in to comment.