Skip to content

Commit

Permalink
Merge pull request #14 from HerodotusDev/hotfix/hint-expected-nibble
Browse files Browse the repository at this point in the history
  • Loading branch information
codyx authored Jan 20, 2025
2 parents c670c1b + 583fe77 commit daf6c79
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cairo_vm_hints/src/hints/lib/rlp_little/leading_zeros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ pub fn hint_expected_nibble(
let key_leading_zeroes_nibbles: usize = utils::get_value("key_leading_zeroes_nibbles", vm, hint_data)?.try_into().unwrap();
let nibble_index: usize = utils::get_value("nibble_index", vm, hint_data)?.try_into().unwrap();

let hex = hex::encode([key_high.to_be_bytes(), key_low.to_be_bytes()].concat());
let hex = hex::encode([key_high.to_be_bytes(), key_low.to_be_bytes()].concat())
.trim_start_matches('0')
.to_string();
let nibble_char = format!("{:0width$}{}", "", hex, width = key_leading_zeroes_nibbles)
.chars()
.nth(nibble_index + key_leading_zeroes_nibbles)
Expand Down

0 comments on commit daf6c79

Please sign in to comment.