10#include <validation.h>
12#include <test/util/setup_common.h>
18struct TestBlockAndIndex {
19 const std::unique_ptr<const TestingSetup> testing_setup{
30 stream.write({&a, 1});
34 blockHash = block.GetHash();
35 blockindex.phashBlock = &blockHash;
36 blockindex.nBits = 403014710;
43 TestBlockAndIndex data;
46 data.testing_setup->m_node.chainman->m_blockman, data.block,
47 &data.blockindex, &data.blockindex,
true);
55 TestBlockAndIndex data;
56 auto univalue =
blockToJSON(data.testing_setup->m_node.chainman->m_blockman,
57 data.block, &data.blockindex, &data.blockindex,
60 auto str = univalue.write();
UniValue blockToJSON(BlockManager &blockman, const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails)
Block description to JSON.
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
The block chain is a tree shaped structure starting with the genesis block at the root,...
Double ended buffer combining vector and stream-like interfaces.
Main entry point to nanobench's benchmarking facility.
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
void doNotOptimizeAway(Arg &&arg)
Makes sure none of the given arguments are optimized away by the compiler.
const std::vector< uint8_t > block413567
static void BlockToJsonVerbose(benchmark::Bench &bench)
BENCHMARK(BlockToJsonVerbose)
static void BlockToJsonVerboseWrite(benchmark::Bench &bench)
A BlockHash is a unqiue identifier for a block.
static const int PROTOCOL_VERSION
network protocol versioning