Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
merkle_tests.cpp File Reference
#include <consensus/merkle.h>
#include <test/util/common.h>
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <boost/test/unit_test.hpp>
Include dependency graph for merkle_tests.cpp:

Go to the source code of this file.

Functions

static uint256 ComputeMerkleRootFromBranch (const uint256 &leaf, const std::vector< uint256 > &vMerkleBranch, uint32_t nIndex)
static uint256 BlockBuildMerkleTree (const CBlock &block, bool *fMutated, std::vector< uint256 > &vMerkleTree)
static std::vector< uint256BlockGetMerkleBranch (const CBlock &block, const std::vector< uint256 > &vMerkleTree, int nIndex)
static int ctz (uint32_t i)
 BOOST_AUTO_TEST_CASE (merkle_test)
 BOOST_AUTO_TEST_CASE (merkle_test_empty_block)
 BOOST_AUTO_TEST_CASE (merkle_test_oneTx_block)
 BOOST_AUTO_TEST_CASE (merkle_test_OddTxWithRepeatedLastTx_block)
 BOOST_AUTO_TEST_CASE (merkle_test_LeftSubtreeRightSubtree)
 BOOST_AUTO_TEST_CASE (merkle_test_BlockWitness)

Function Documentation

◆ BlockBuildMerkleTree()

uint256 BlockBuildMerkleTree ( const CBlock & block,
bool * fMutated,
std::vector< uint256 > & vMerkleTree )
static

Definition at line 28 of file merkle_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ BlockGetMerkleBranch()

std::vector< uint256 > BlockGetMerkleBranch ( const CBlock & block,
const std::vector< uint256 > & vMerkleTree,
int nIndex )
static

Definition at line 56 of file merkle_tests.cpp.

Here is the caller graph for this function:

◆ BOOST_AUTO_TEST_CASE() [1/6]

BOOST_AUTO_TEST_CASE ( merkle_test )

Definition at line 80 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [2/6]

BOOST_AUTO_TEST_CASE ( merkle_test_BlockWitness )

Definition at line 232 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [3/6]

BOOST_AUTO_TEST_CASE ( merkle_test_empty_block )

Definition at line 150 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [4/6]

BOOST_AUTO_TEST_CASE ( merkle_test_LeftSubtreeRightSubtree )

Definition at line 203 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [5/6]

BOOST_AUTO_TEST_CASE ( merkle_test_OddTxWithRepeatedLastTx_block )

Definition at line 179 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ BOOST_AUTO_TEST_CASE() [6/6]

BOOST_AUTO_TEST_CASE ( merkle_test_oneTx_block )

Definition at line 165 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ ComputeMerkleRootFromBranch()

uint256 ComputeMerkleRootFromBranch ( const uint256 & leaf,
const std::vector< uint256 > & vMerkleBranch,
uint32_t nIndex )
static

Definition at line 14 of file merkle_tests.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctz()

int ctz ( uint32_t i)
inlinestatic

Definition at line 70 of file merkle_tests.cpp.

Here is the caller graph for this function: