Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
update verify validations (#131)
Browse files Browse the repository at this point in the history
* ♻️ Add some extra validation for verify_query_keys function in the SMT

 - Also refactor verify function of SMT to reduce the number of loops

* ♻️ Refactor code to reduce the number of loops in the verify function

* ♻️ Fix some bugs and rename function name

* ♻️ Edit based on the last commit of the verify function in LIP39

* ♻️ Edit to use binary_path as the key of the queries HashMap

* ✅ Add a new test for the verify function of SMT

* ♻️ Fix some bugs

* ♻️ Refactor to return Result instead of tuple

* ✅ Add a new unit test for verify_and_prepare_proof_map

 - Also edit to optimize initialize HashMap

* ♻️ Refactor for optimization

 - Also remove duplicate unit test

* ♻️ Fix clippy error

* ♻️ Add verify function in the unit test
  • Loading branch information
hrmhatef authored Aug 30, 2023
1 parent 83193c9 commit b42eec5
Show file tree
Hide file tree
Showing 2 changed files with 475 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct Writer {

fn write_varint(value: u32) -> Vec<u8> {
let mut value = value;
let mut result = vec![0; MAX_VARINT_LEN];
let mut result = [0; MAX_VARINT_LEN];
let mut index = 0;
while value > 0x7f {
result[index] = 0x80 | (value & 0x7f) as u8;
Expand Down
Loading

0 comments on commit b42eec5

Please sign in to comment.