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

Commit

Permalink
🐛 Fix verify proof function by checking if all sibling hashes were used.
Browse files Browse the repository at this point in the history
  • Loading branch information
matjazv committed Jul 3, 2023
1 parent 9fee39f commit 2172a8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/sparse_merkle_tree/smt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1402,6 +1402,11 @@ impl SparseMerkleTree {
while !sorted_queries.is_empty() {
let query = &sorted_queries.pop_front().unwrap();
if query.is_zero_height() {
if next_sibling_hash != sibling_hashes.len() {
return Err(SMTError::InvalidInput(String::from(
"Not all sibling hashes were used",
)));
}
return Ok(query.hash.clone());
}

Expand Down

0 comments on commit 2172a8f

Please sign in to comment.