mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-14 08:39:35 +02:00
test: adjust ComputeMerkleRoot tests
Update the integer fuzz test to move the vector into `ComputeMerkleRoot`, matching production usage patterns and avoiding unnecessary copies. Update `merkle_test_BlockWitness` to use an odd number of transactions to ensure the test covers the scenario where leaf duplication occurs. Also switch to `GetWitnessHash` to match `BlockWitnessMerkleRoot` semantics. The manual vector setup retains the exact-size `resize` to explicitly verify the behavior against the calculated root.
This commit is contained in:
@@ -80,8 +80,8 @@ FUZZ_TARGET(integer, .init = initialize_integer)
|
||||
}
|
||||
constexpr uint256 u256_min{"0000000000000000000000000000000000000000000000000000000000000000"};
|
||||
constexpr uint256 u256_max{"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"};
|
||||
const std::vector<uint256> v256{u256, u256_min, u256_max};
|
||||
(void)ComputeMerkleRoot(v256);
|
||||
std::vector v256{u256, u256_min, u256_max};
|
||||
(void)ComputeMerkleRoot(std::move(v256));
|
||||
(void)DecompressAmount(u64);
|
||||
{
|
||||
if (std::optional<CAmount> parsed = ParseMoney(FormatMoney(i64))) {
|
||||
|
||||
Reference in New Issue
Block a user