9#include <boost/test/unit_test.hpp>
14BOOST_AUTO_TEST_SUITE(merkleblock_tests)
27 Txid txhash1{
Txid::FromHex(
"74d681e0e03bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20").value()};
30 Txid txhash2{
Txid::FromHex(
"f9fc751cb7dc372406a9f8d738d5e6f8f63bab71986a39cf36ee70ee17036d07").value()};
32 txids.insert(txhash1);
33 txids.insert(txhash2);
42 std::vector<uint256> vMatched;
43 std::vector<unsigned int> vIndex;
65 std::set<Txid> txids2;
66 txids2.insert(
Txid::FromHex(
"c0ffee00003bafa802c8aa084379aa98d9fcd632ddc2ed9782b586ec87451f20").value());
72 std::vector<uint256> vMatched;
73 std::vector<unsigned int> vIndex;
Used to relay blocks as header + vector<merkle branch> to filtered nodes.
CBlockHeader header
Public only for unit testing.
std::vector< std::pair< unsigned int, uint256 > > vMatchedTxn
Public only for unit testing and relay testing (not relayed).
uint256 ExtractMatches(std::vector< uint256 > &vMatch, std::vector< unsigned int > &vnIndex)
extract the matching txid's represented by this partial merkle tree and their respective indices with...
std::string GetHex() const
static std::optional< transaction_identifier > FromHex(std::string_view hex)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(merkleblock_construct_from_txids_found)
Create a CMerkleBlock using a list of txids which will be found in the given block.
std::string ToString(const T &t)
Locale-independent version of std::to_string.
#define BOOST_CHECK_EQUAL(v1, v2)