aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz/miniscript.cpp
diff options
context:
space:
mode:
authorAntoine Poinsot <darosior@protonmail.com>2023-01-21 13:52:23 +0100
committerAntoine Poinsot <darosior@protonmail.com>2023-10-08 02:43:15 +0200
commit687a0b0fa53ddd5632287b9e00ad8b0550830287 (patch)
tree0eac61f341a97fb9b8903c0887ce98cca3a6b770 /src/test/fuzz/miniscript.cpp
parent9164c2eca164d78cbae5351d383f39320711efb9 (diff)
miniscript: introduce a multi_a fragment
It is the equivalent of multi() but for Tapscript, using CHECKSIGADD instead of CHECKMULTISIG. It shares the same properties as multi() but for 'n', since a threshold multi_a() may have an empty vector as the top element of its satisfaction. It could also have the 'o' property when it only has a single key, but in this case a 'pk()' is always preferable anyways.
Diffstat (limited to 'src/test/fuzz/miniscript.cpp')
-rw-r--r--src/test/fuzz/miniscript.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/fuzz/miniscript.cpp b/src/test/fuzz/miniscript.cpp
index d85ed707bd..1099e2a00f 100644
--- a/src/test/fuzz/miniscript.cpp
+++ b/src/test/fuzz/miniscript.cpp
@@ -514,6 +514,9 @@ struct SmartInfo
// Based on the fragment, determine #subs/data/k/keys to pass to ComputeType. */
switch (frag) {
+ case Fragment::MULTI_A:
+ // TODO: Tapscript support.
+ assert(false);
case Fragment::PK_K:
case Fragment::PK_H:
n_keys = 1;
@@ -703,6 +706,9 @@ std::optional<NodeInfo> ConsumeNodeSmart(FuzzedDataProvider& provider, Type type
// Based on the fragment the recipe uses, fill in other data (k, keys, data).
switch (frag) {
+ case Fragment::MULTI_A:
+ // TODO: Tapscript support.
+ assert(false);
case Fragment::PK_K:
case Fragment::PK_H:
return {{frag, ConsumePubKey(provider)}};
@@ -793,6 +799,9 @@ NodeRef GenNode(F ConsumeNode, Type root_type, bool strict_valid = false) {
scriptsize += miniscript::internal::ComputeScriptLen(node_info->fragment, ""_mst, node_info->subtypes.size(), node_info->k, node_info->subtypes.size(), node_info->keys.size()) - 1;
if (scriptsize > MAX_STANDARD_P2WSH_SCRIPT_SIZE) return {};
switch (node_info->fragment) {
+ case Fragment::MULTI_A:
+ // TODO: Tapscript support.
+ assert(false);
case Fragment::JUST_0:
case Fragment::JUST_1:
break;
@@ -1019,6 +1028,9 @@ void TestNode(const NodeRef& node, FuzzedDataProvider& provider)
// satisfaction will also match the expected policy.
bool satisfiable = node->IsSatisfiable([](const Node& node) -> bool {
switch (node.fragment) {
+ case Fragment::MULTI_A:
+ // TODO: Tapscript support.
+ assert(false);
case Fragment::PK_K:
case Fragment::PK_H: {
auto it = TEST_DATA.dummy_sigs.find(node.keys[0]);