Skip to content

Commit d0852f3

Browse files
author
MarcoFalke
committed
Merge #20998: test: Fix BlockToJsonVerbose benchmark
7487bc9 Fix BlockToJsonVerbose benchmark (Martin Ankerl) Pull request description: Currently it was not possible to run just the BlockToJsonVerbose benchmark because it did not set up everything it needed, running `bench_bitcoin -filter=BlockToJsonVerbose` caused this assert to fail: ``` bench_bitcoin: chainparams.cpp:506: const CChainParams& Params(): Assertion `globalChainParams' failed. ``` Initializing TestingSetup fixes this. ACKs for top commit: theStack: Tested ACK 7487bc9 🐎 Tree-SHA512: 27b9702cb4bacc0475710f7b31f41844e83b8a0787685380749505d179aba724728604d4e4e2e3b3cb38cde88ab12f170881b5d3eb615872ee84632e85312166
2 parents f707fcd + 7487bc9 commit d0852f3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bench/rpc_blockchain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@
77

88
#include <rpc/blockchain.h>
99
#include <streams.h>
10+
#include <test/util/setup_common.h>
1011
#include <validation.h>
1112

1213
#include <univalue.h>
1314

1415
static void BlockToJsonVerbose(benchmark::Bench& bench)
1516
{
17+
TestingSetup test_setup{};
18+
1619
CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION);
1720
char a = '\0';
1821
stream.write(&a, 1); // Prevent compaction

0 commit comments

Comments
 (0)