Skip to content

Commit a87fd40

Browse files
authored
Merge pull request #175 from sanket1729/sorted_multi_fixup
Sorted Multi explaination for satisfied constraint
2 parents f669496 + 936ec1f commit a87fd40

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/descriptor/satisfied_constraints.rs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,26 @@ where
337337
has_errored: false,
338338
}
339339
}
340-
&Descriptor::WshSortedMulti(_) | &Descriptor::ShWshSortedMulti(_) => unimplemented!(),
341-
&Descriptor::ShSortedMulti(_) => unimplemented!(),
340+
// We can leave this as unimplemented because this is supposed to be used to
341+
// Descriptor::from_txin_and_witness which outputs Stack required for the
342+
// constructor of this function.
343+
// Currently, there is no other way in the library to produce stack arg required
344+
// by the function and hence it is safe to assume that user would use the same
345+
// descriptor. To trigger the panic, the user would have to create it's own
346+
// descriptor, use the stack obtained from from_txin_and_witness ignoring the
347+
// other descrpitor output of the function.
348+
// In future, we can remove this by adding another iterator to this if there is
349+
// a usecase of this.
350+
&Descriptor::WshSortedMulti(_) | &Descriptor::ShWshSortedMulti(_) => unimplemented!(
351+
"This API is supposed to be used with from_txin_and_witness \\
352+
which cannot output a sorted multi descriptor and thus this code is \\
353+
currently unimplemented."
354+
),
355+
&Descriptor::ShSortedMulti(_) => unimplemented!(
356+
"This API is supposed to be used with from_txin_and_witness \\
357+
which cannot output a sorted multi descriptor and thus this code is \\
358+
currently unimplemented."
359+
),
342360
}
343361
}
344362
}

0 commit comments

Comments
 (0)