Fixed Merkle proof generation for aux chains

This commit is contained in:
SChernykh
2023-12-10 19:24:05 +01:00
parent 38417b0fd5
commit 658d756120
9 changed files with 58 additions and 91 deletions

View File

@@ -73,19 +73,10 @@ TEST(merkle, tree)
for (size_t i = 0, n = hashes.size(); i < n; ++i) {
const hash& h = hashes[i];
std::vector<std::pair<bool, hash>> proof;
std::vector<hash> proof;
ASSERT_TRUE(get_merkle_proof(tree, h, proof));
ASSERT_TRUE(verify_merkle_proof(h, proof, root));
std::vector<hash> proof2;
proof2.reserve(proof.size());
for (const auto& p : proof) {
proof2.emplace_back(p.second);
}
ASSERT_TRUE(verify_merkle_proof(h, proof2, i, n, root));
ASSERT_TRUE(verify_merkle_proof(h, proof, i, n, root));
}
};