mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-13 01:27:00 +02:00
Enforce type consistency in miniscript_stable fuzz test
Add a self-check to the fuzzer that the constructed types match the expected types in the miniscript_stable fuzzer too.
This commit is contained in:
@ -806,10 +806,13 @@ NodeRef GenNode(F ConsumeNode, Type root_type, bool strict_valid = false) {
|
||||
node = MakeNodeRef(info.fragment, std::move(info.keys), info.k);
|
||||
}
|
||||
// Verify acceptability.
|
||||
if (!node || !(node->GetType() << type_needed)) {
|
||||
if (!node || (node->GetType() & "KVWB"_mst) == ""_mst) {
|
||||
assert(!strict_valid);
|
||||
return {};
|
||||
}
|
||||
if (!(type_needed == ""_mst)) {
|
||||
assert(node->GetType() << type_needed);
|
||||
}
|
||||
if (!node->IsValid()) return {};
|
||||
// Move it to the stack.
|
||||
stack.push_back(std::move(node));
|
||||
|
Reference in New Issue
Block a user