-
Notifications
You must be signed in to change notification settings - Fork 39.2k
merkle: migrate path arg to reference and drop unused args
#33805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,7 +51,7 @@ FUZZ_TARGET(merkle) | |
| } | ||
|
|
||
| // Test ComputeMerkleRoot | ||
| bool mutated = fuzzed_data_provider.ConsumeBool(); | ||
| bool mutated = fuzzed_data_provider.ConsumeBool(); // output param, initial value shouldn't matter | ||
|
l0rinc marked this conversation as resolved.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think there would be value in also passing in nullptr: diff --git a/src/test/fuzz/merkle.cpp b/src/test/fuzz/merkle.cpp
index 4bb91faf0b..5b91a97b75 100644
--- a/src/test/fuzz/merkle.cpp
+++ b/src/test/fuzz/merkle.cpp
@@ -55 +55,2 @@ FUZZ_TARGET(merkle)
- const uint256 merkle_root = ComputeMerkleRoot(tx_hashes, &mutated);
+ bool* pmutated = fuzzed_data_provider.PickValueInArray({&mutated, static_cast<bool*>(nullptr)});
+ const uint256 merkle_root = ComputeMerkleRoot(tx_hashes, pmutated);
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we should do that in a follow-up, thanks
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, added in #34050 |
||
| const uint256 merkle_root = ComputeMerkleRoot(tx_hashes, &mutated); | ||
|
|
||
| // Basic sanity checks for ComputeMerkleRoot | ||
|
|
@@ -66,7 +66,7 @@ FUZZ_TARGET(merkle) | |
| } | ||
|
|
||
| if (!block->vtx.empty()){ | ||
| const uint256 block_witness_merkle_root = BlockWitnessMerkleRoot(*block, &mutated); | ||
| const uint256 block_witness_merkle_root = BlockWitnessMerkleRoot(*block); | ||
| if (tx_hashes.size() == 1) { | ||
| assert(block_witness_merkle_root == uint256()); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.