Commit 3dd006a
committed
miniscript: remove Ctx::check_witness
This is a weird function. Its role is to double-check a witness after it
has been produced to ensure that it falls within limits. If you are
working with a sane miniscript this is impossible to fail, and if you're
working with an insane miniscript then the checks are too strong -- it
verifies standardness rules rather than consensus.
This was introduced in #189 without much discussion. It had no tests
then and has no tests now -- everything continues to pass.
I am removing it for now. I will later replace it with an API where you
call Plan::validate if you want to do checks like this. If the user wants
to do something oddball like "parse a miniscript without checking satisfaction
limits, then produce a satisfaction and see if the result is nonetheless
within limits" the workflow will be:
1. Parse an insane Miniscript
2. Produce a Plan
3. Run Plan::validate with tighter validation params than were used in
step 1.
This gives the user a fair bit more flexibility. It is an awkward and
hard to discover workflow, but IMO it's better than we have now.1 parent 6c723ed commit 3dd006a
2 files changed
+1
-56
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | 191 | | |
203 | 192 | | |
204 | 193 | | |
| |||
389 | 378 | | |
390 | 379 | | |
391 | 380 | | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | 381 | | |
406 | 382 | | |
407 | 383 | | |
| |||
506 | 482 | | |
507 | 483 | | |
508 | 484 | | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
513 | | - | |
514 | | - | |
515 | | - | |
516 | | - | |
517 | | - | |
518 | | - | |
519 | 485 | | |
520 | 486 | | |
521 | 487 | | |
| |||
627 | 593 | | |
628 | 594 | | |
629 | 595 | | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | 596 | | |
642 | 597 | | |
643 | 598 | | |
| |||
882 | 837 | | |
883 | 838 | | |
884 | 839 | | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | 840 | | |
893 | 841 | | |
894 | 842 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
474 | | - | |
475 | | - | |
476 | | - | |
477 | | - | |
| 474 | + | |
478 | 475 | | |
479 | 476 | | |
480 | 477 | | |
| |||
0 commit comments