Added merkle proofs

This commit is contained in:
SChernykh
2023-10-22 23:31:07 +02:00
parent e51af9e6e8
commit 12a3eb862e
3 changed files with 86 additions and 0 deletions

View File

@@ -69,6 +69,12 @@ TEST(merkle, root_hash)
ASSERT_EQ(tmp, tree[i][j]);
}
}
for (const hash& h : hashes) {
std::vector<std::pair<bool, hash>> proof;
ASSERT_TRUE(get_merkle_proof(tree, h, proof));
ASSERT_TRUE(verify_merkle_proof(h, proof, root));
}
};
// 1 leaf