 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
10 #include <test/util/setup_common.h>
11 #include <validation.h>
17 struct TestBlockAndIndex {
18 const std::unique_ptr<const TestingSetup> testing_setup{MakeNoLogFileContext<const TestingSetup>(
CBaseChainParams::MAIN)};
31 blockHash = block.GetHash();
32 blockindex.phashBlock = &blockHash;
33 blockindex.nBits = 403014710;
41 TestBlockAndIndex data;
43 auto univalue =
blockToJSON(data.block, &data.blockindex, &data.blockindex,
true);
52 TestBlockAndIndex data;
53 auto univalue =
blockToJSON(data.block, &data.blockindex, &data.blockindex,
true);
55 auto str = univalue.write();
static void BlockToJsonVerboseWrite(benchmark::Bench &bench)
static void BlockToJsonVerbose(benchmark::Bench &bench)
Main entry point to nanobench's benchmarking facility.
const std::vector< uint8_t > block413567
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
BENCHMARK(BlockToJsonVerbose)
static const std::string MAIN
Chain name strings.
Double ended buffer combining vector and stream-like interfaces.
The block chain is a tree shaped structure starting with the genesis block at the root,...
UniValue blockToJSON(const CBlock &block, const CBlockIndex *tip, const CBlockIndex *blockindex, bool txDetails)
Block description to JSON.
static const int PROTOCOL_VERSION
network protocol versioning
void doNotOptimizeAway(Arg &&arg)
Makes sure none of the given arguments are optimized away by the compiler.