MCPcopy Create free account
hub / github.com/ElementsProject/elements / DeserializeBlockTest

Function DeserializeBlockTest

src/bench/checkblock.cpp:17–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15// compact block relay.
16
17static void DeserializeBlockTest(benchmark::Bench& bench)
18{
19 CDataStream stream(benchmark::data::block413567, SER_NETWORK, PROTOCOL_VERSION);
20 std::byte a{0};
21 stream.write({&a, 1}); // Prevent compaction
22
23 bench.unit("block").run([&] {
24 CBlock block;
25 stream >> block;
26 bool rewound = stream.Rewind(benchmark::data::block413567.size());
27 assert(rewound);
28 });
29}
30
31static void DeserializeAndCheckBlockTest(benchmark::Bench& bench)
32{

Callers

nothing calls this directly

Calls 4

writeMethod · 0.45
runMethod · 0.45
RewindMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected