aboutsummaryrefslogtreecommitdiff
path: root/src/bench
diff options
context:
space:
mode:
authorMartin Ankerl <martin.ankerl@gmail.com>2021-01-24 10:31:13 +0100
committerMartin Ankerl <martin.ankerl@gmail.com>2021-01-24 10:31:13 +0100
commit7487bc9900d28e1b5361cba882fd8783aafc7092 (patch)
tree2c3c8778159e9611823b00f8661510b7c7f4c5c8 /src/bench
parent32b191fb66e644c690c94cbfdae6ddbc754769d7 (diff)
downloadbitcoin-7487bc9900d28e1b5361cba882fd8783aafc7092.tar.xz
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.
Diffstat (limited to 'src/bench')
-rw-r--r--src/bench/rpc_blockchain.cpp3
1 files changed, 3 insertions, 0 deletions
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 <rpc/blockchain.h>
#include <streams.h>
+#include <test/util/setup_common.h>
#include <validation.h>
#include <univalue.h>
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