mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-31 00:05:13 +02:00
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.
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user