When running mutation testing for src/script/descriptor.cpp, I noticed that the following mutant was not killed:
diff --git a/src/script/descriptor.cpp b/src/script/descriptor.cpp
index 3b73a40cce..29775ba75f 100644
--- a/src/script/descriptor.cpp
+++ b/src/script/descriptor.cpp
@@ -2393,7 +2393,7 @@ std::vector<std::unique_ptr<DescriptorImpl>> ParseScript(uint32_t& key_exp_index
return {};
}
if (ctx == ParseScriptContext::TOP) {
- if (providers.size() > 3) {
+ if (providers.size() >= 3) {
error = strprintf("Cannot have %u pubkeys in bare multisig; only at most 3 pubkeys", providers.size());
return {};
}
We current have a test case that verifies we cannot have 4 pubkeys in bare multisig, but we are not testing that exactly 3 pubkeys are allowed. This PR adds a test case for it.