From b8eb6c2081a250333279b0da114d974f6e22a305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C5=91rinc?= Date: Tue, 7 Apr 2026 23:32:05 +0300 Subject: [PATCH] refactor: use `SpanReader` in `TestBlockAndIndex` `TestBlockAndIndex` still deserialized its fixed block fixture through `DataStream` and appended a dummy byte to avoid compaction after full consumption. Use `SpanReader` for that fixture instead. This removes the leftover dummy-byte workaround and reads the immutable fixture through a read-only view. --- src/bench/rpc_blockchain.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/bench/rpc_blockchain.cpp b/src/bench/rpc_blockchain.cpp index 0e89ac78a13..fe83c4a26f7 100644 --- a/src/bench/rpc_blockchain.cpp +++ b/src/bench/rpc_blockchain.cpp @@ -31,10 +31,7 @@ struct TestBlockAndIndex { TestBlockAndIndex() { - DataStream stream{benchmark::data::block413567}; - std::byte a{0}; - stream.write({&a, 1}); // Prevent compaction - + SpanReader stream{benchmark::data::block413567}; stream >> TX_WITH_WITNESS(block); blockHash = block.GetHash();