Bitcoin Core 28.99.0
P2P Digital Currency
Functions
merkle_tests.cpp File Reference
#include <consensus/merkle.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()

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

Definition at line 27 of file merkle_tests.cpp.

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

◆ BlockGetMerkleBranch()

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

Definition at line 55 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 79 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 226 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 149 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 197 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 173 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 159 of file merkle_tests.cpp.

Here is the call graph for this function:

◆ ComputeMerkleRootFromBranch()

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

Definition at line 13 of file merkle_tests.cpp.

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

◆ ctz()

static int ctz ( uint32_t  i)
inlinestatic

Definition at line 69 of file merkle_tests.cpp.

Here is the caller graph for this function: