From 7487bc9900d28e1b5361cba882fd8783aafc7092 Mon Sep 17 00:00:00 2001 From: Martin Ankerl Date: Sun, 24 Jan 2021 10:31:13 +0100 Subject: 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. --- src/bench/rpc_blockchain.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/bench/rpc_blockchain.cpp b/src/bench/rpc_blockchain.cpp index 4b45264a3c..45ed9f60dc 100644 --- a/src/bench/rpc_blockchain.cpp +++ b/src/bench/rpc_blockchain.cpp @@ -7,12 +7,15 @@ #include #include +#include #include #include static void BlockToJsonVerbose(benchmark::Bench& bench) { + TestingSetup test_setup{}; + CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION); char a = '\0'; stream.write(&a, 1); // Prevent compaction -- cgit v1.2.3