Skip to content

Commit 7487bc9

Browse files
committed
Fix BlockToJsonVerbose benchmark
Currently it was not possible to run just the BlockToJsonVerboes benchmarsk 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.
1 parent 32b191f commit 7487bc9

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)