MCPcopy Create free account
hub / github.com/BTCGPU/BTCGPU / DeserializeBlockTest

Function DeserializeBlockTest

src/bench/checkblock.cpp:20–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18// compact block relay.
19
20static void DeserializeBlockTest(benchmark::State& state)
21{
22 CDataStream stream((const char*)block_bench::block413567,
23 (const char*)&block_bench::block413567[sizeof(block_bench::block413567)],
24 SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_BLOCK_LEGACY);
25 char a = '\0';
26 stream.write(&a, 1); // Prevent compaction
27
28 while (state.KeepRunning()) {
29 CBlock block;
30 stream >> block;
31 assert(stream.Rewind(sizeof(block_bench::block413567)));
32 }
33}
34
35static void DeserializeAndCheckBlockTest(benchmark::State& state)
36{

Callers

nothing calls this directly

Calls 3

KeepRunningMethod · 0.80
RewindMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected