From d1527f6b88656ff4aab3c671c6d9780ea2ae986e Mon Sep 17 00:00:00 2001 From: Antoine Poinsot Date: Wed, 19 Feb 2025 15:56:45 -0500 Subject: [PATCH] qa: correct off-by-one in utxo snapshot fuzz target The chain starts at block 1, not genesis. --- src/kernel/chainparams.cpp | 2 +- src/test/fuzz/utxo_snapshot.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp index 349e14a5d6e..f3046e5ff11 100644 --- a/src/kernel/chainparams.cpp +++ b/src/kernel/chainparams.cpp @@ -623,7 +623,7 @@ public: { // For use by fuzz target src/test/fuzz/utxo_snapshot.cpp .height = 200, - .hash_serialized = AssumeutxoHash{uint256{"4f34d431c3e482f6b0d67b64609ece3964dc8d7976d02ac68dd7c9c1421738f2"}}, + .hash_serialized = AssumeutxoHash{uint256{"7e3b7780fbd2fa479a01f66950dc8f728dc1b11f03d06d5bf223168520df3a48"}}, .m_chain_tx_count = 201, .blockhash = consteval_ctor(uint256{"5e93653318f294fb5aa339d00bbf8cf1c3515488ad99412c37608b139ea63b27"}), }, diff --git a/src/test/fuzz/utxo_snapshot.cpp b/src/test/fuzz/utxo_snapshot.cpp index 5eb6a323202..5a9df1e48a4 100644 --- a/src/test/fuzz/utxo_snapshot.cpp +++ b/src/test/fuzz/utxo_snapshot.cpp @@ -101,7 +101,7 @@ void utxo_snapshot_fuzz(FuzzBufferType buffer) std::vector file_data{ConsumeRandomLengthByteVector(fuzzed_data_provider)}; outfile << Span{file_data}; } else { - int height{0}; + int height{1}; for (const auto& block : *g_chain) { auto coinbase{block->vtx.at(0)}; outfile << coinbase->GetHash();