Commit 4114967
committed
Merge #772: feat: check policy validity to prevent duplicate check
757daee feat: check policy validity in from_ast to prevent duplicate check (ChrisCho-H)
Pull request description:
- `Miniscript::from_ast()` only executes `check_global_consensus_validity()` which does not include `check_global_policy_validity()`. Change to use `check_global_validity()` to check both consensus and policy validness.
- `wrap_into_miniscript()` executes `check_global_validity()` internally after `Miniscript::from_ast()`. As `Miniscript::from_ast()` now executes `check_global_validity()`, it doesn't have to check duplicately.
I was originally thinking to change `check_global_validity()` inside `wrap_into_miniscript()` to `check_global_policy_validity()`(as consensus check is done by `from_ast()`). I think it's better to strengthen the validness check in `from_ast()`, and do nothing in `wrap_into_miniscript()`.
ACKs for top commit:
apoelstra:
ACK 757daee; successfully ran local tests
Tree-SHA512: e6afc44b8e5fa9310d6656f1d624f8f3b25c893c02e6e2936e924e5e78f0d4beba53c5114c49348a572d1ea5a2b3af4739bc6bcd8ea22c968b3cc47c6f521bd31 file changed
+1
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
746 | 745 | | |
747 | 746 | | |
748 | 747 | | |
| |||
759 | 758 | | |
760 | 759 | | |
761 | 760 | | |
762 | | - | |
763 | 761 | | |
764 | 762 | | |
765 | 763 | | |
| |||
0 commit comments