add test_get_proof

This commit is contained in:
Rostyslav Tyshko 2024-10-18 02:38:35 +02:00
parent 7b9d1bafaf
commit 994e8ff802

View File

@ -142,4 +142,15 @@ mod tests {
assert_eq!(tree.get_tx(tx1.hash()), Some(&tx1));
assert_eq!(tree.get_tx(tx2.hash()), Some(&tx2));
}
#[test]
fn test_get_proof() {
let tx1 = MockTransaction { hash: get_first_32_bytes("tx1") };
let tx2 = MockTransaction { hash: get_first_32_bytes("tx2") };
let tree = HashStorageMerkleTree::new(vec![tx1.clone(), tx2.clone()]);
let proof = tree.get_proof(tx1.hash());
assert!(proof.is_some());
}
}