17#include <boost/test/unit_test.hpp>
28 *(
vHash[n].begin() + (bit>>3)) ^= 1<<(bit&7);
38 static const unsigned int tx_counts[] = {1, 4, 7, 17, 56, 100, 127, 256, 312, 513, 1000, 4095};
40 for (
int i = 0; i < 12; i++) {
45 for (
unsigned int j=0;
j<nTx;
j++) {
53 std::vector<Txid>
vTxid(nTx);
54 for (
unsigned int j=0;
j<nTx;
j++)
65 std::vector<bool>
vMatch(nTx,
false);
67 for (
unsigned int j=0;
j<nTx;
j++) {
91 std::vector<unsigned int>
vIndex;
102 for (
int j=0;
j<4;
j++) {
115 std::vector<Txid>
vTxid{
123 std::vector<bool>
vMatch = {
false,
false,
false,
false,
false,
false,
false,
false,
false,
true,
true,
false};
126 std::vector<unsigned int>
vIndex;
134 std::vector<uint256>
hashes;
141 std::vector<unsigned int> indexes;
std::vector< CTransactionRef > vtx
Data structure that represents a partial merkle tree.
std::vector< uint256 > vHash
txids and internal hashes
CPartialMerkleTreeTester(FastRandomContext &rng)
FastRandomContext & m_rng
Double ended buffer combining vector and stream-like interfaces.
I randrange(I range) noexcept
Generate a random integer in the range [0..range), with range > 0.
uint64_t randbits(int bits) noexcept
Generate a random (bits)-bit integer.
static transaction_identifier FromUint256(const uint256 &id)
uint256 BlockMerkleRoot(const CBlock &block, bool *mutated)
constexpr size_t MIN_TRANSACTION_WEIGHT
constexpr unsigned int MAX_BLOCK_WEIGHT
The maximum allowed weight for a block, see BIP 141 (network rule)
BOOST_FIXTURE_TEST_SUITE(cuckoocache_tests, BasicTestingSetup)
Test Suite for CuckooCache.
BOOST_AUTO_TEST_SUITE_END()
#define BOOST_CHECK_EQUAL(v1, v2)
#define BOOST_CHECK(expr)
BOOST_AUTO_TEST_CASE(pmt_test1)
static CTransactionRef MakeTransactionRef(Tx &&txIn)
#define extract(n)
Extract the lowest 64 bits of (c0,c1,c2) into n, and left shift the number 64 bits.
A mutable version of CTransaction.
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.