Added path bitmap to get_merkle_proof

This commit is contained in:
SChernykh
2024-05-10 15:20:27 +02:00
parent e986e5dc2e
commit f67009f133
13 changed files with 53 additions and 16 deletions

View File

@@ -19,6 +19,7 @@
#include "keccak.h"
#include "merkle.h"
#include "pool_block.h"
#include "keccak.h"
#include "gtest/gtest.h"
namespace p2pool {
@@ -74,9 +75,11 @@ TEST(merkle, tree)
for (size_t i = 0, n = hashes.size(); i < n; ++i) {
const hash& h = hashes[i];
std::vector<hash> proof;
uint32_t path;
ASSERT_TRUE(get_merkle_proof(tree, h, proof));
ASSERT_TRUE(get_merkle_proof(tree, h, proof, path));
ASSERT_TRUE(verify_merkle_proof(h, proof, i, n, root));
ASSERT_TRUE(verify_merkle_proof(h, proof, path, root));
}
};