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.
This commit is contained in:
1 parent
32b191fb66
commit
7487bc9900
1 file changed
+3
@@ -7,12 +7,15 @@
|
|||||||
|
|
||||||
#include <rpc/blockchain.h>
|
#include <rpc/blockchain.h>
|
||||||
#include <streams.h>
|
#include <streams.h>
|
||||||
|
#include <test/util/setup_common.h>
|
||||||
#include <validation.h>
|
#include <validation.h>
|
||||||
|
|
||||||
#include <univalue.h>
|
#include <univalue.h>
|
||||||
|
|
||||||
static void BlockToJsonVerbose(benchmark::Bench& bench)
|
static void BlockToJsonVerbose(benchmark::Bench& bench)
|
||||||
{
|
{
|
||||||
|
TestingSetup test_setup{};
|
||||||
|
|
||||||
CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION);
|
CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION);
|
||||||
char a = '\0';
|
char a = '\0';
|
||||||
stream.write(&a, 1); // Prevent compaction
|
stream.write(&a, 1); // Prevent compaction
|
||||||
|
|||||||
Reference in new issue
Block a user