6 #include <bench/data/block413567.raw.h> 18 #include <validation.h> 26 struct TestBlockAndIndex {
27 const std::unique_ptr<const TestingSetup> testing_setup{MakeNoLogFileContext<const TestingSetup>(
ChainType::MAIN)};
34 DataStream stream{benchmark::data::block413567};
36 stream.
write({&a, 1});
40 blockHash = block.GetHash();
41 blockindex.phashBlock = &blockHash;
42 blockindex.nBits = 403014710;
50 TestBlockAndIndex
data;
51 const uint256 pow_limit{
data.testing_setup->m_node.chainman->GetParams().GetConsensus().powLimit};
62 TestBlockAndIndex
data;
63 const uint256 pow_limit{
data.testing_setup->m_node.chainman->GetParams().GetConsensus().powLimit};
66 auto str = univalue.write();
The same as previous option with information about prevouts if available.
UniValue blockToJSON(BlockManager &blockman, const CBlock &block, const CBlockIndex &tip, const CBlockIndex &blockindex, TxVerbosity verbosity, const uint256 pow_limit)
Block description to JSON.
void write(Span< const value_type > src)
static void BlockToJsonVerboseWrite(benchmark::Bench &bench)
Bench & run(char const *benchmarkName, Op &&op)
Repeatedly calls op() based on the configuration, and performs measurements.
Double ended buffer combining vector and stream-like interfaces.
void doNotOptimizeAway(Arg &&arg)
Makes sure none of the given arguments are optimized away by the compiler.
static void BlockToJsonVerbose(benchmark::Bench &bench)
The block chain is a tree shaped structure starting with the genesis block at the root...
Main entry point to nanobench's benchmarking facility.
BENCHMARK(BlockToJsonVerbose, benchmark::PriorityLevel::HIGH)
static constexpr TransactionSerParams TX_WITH_WITNESS