Avoid termination due to unhandled exception when parsing invalid arguments to after(...), older(...), thresh(...) and thresh_m(...)#3
Closed
practicalswift wants to merge 1 commit intosipa:masterfrom
practicalswift:handle-exceptions-gracefully
Closed
Avoid termination due to unhandled exception when parsing invalid arguments to after(...), older(...), thresh(...) and thresh_m(...)#3practicalswift wants to merge 1 commit intosipa:masterfrom practicalswift:handle-exceptions-gracefully
practicalswift wants to merge 1 commit intosipa:masterfrom
practicalswift:handle-exceptions-gracefully
Conversation
Owner
|
Nice find. It'd be better to abstract out the whole parse-a-number-and-catch-if-necessary logic rather than repeating it 4 times, though. |
Contributor
Author
|
@sipa Good point! I thought about that but wasn't sure about your preference. I'll add a function :-) |
…uments to after(...), older(...), thresh(...) and thresh_m(...)
Contributor
Author
|
Now using When reviewing please note the change from Looks OK? |
Owner
|
@practicalswift Sorry, I forgot about this. I fixed this independently after seeing the Bitcoin Core linter complaining about the use of locale-dependent functions |
Amperstrand
added a commit
to Amperstrand/miniscript-sipa
that referenced
this pull request
Dec 7, 2025
- Add verbose error output with JSON for failed tests - Default to showing only failed tests for cleaner output - Add CSS styling for JSON debug output New Common Miniscript Use Cases tests: - Single key (pk(A)) - One of two keys (equally likely) - or_b - One of two keys (one likely, one unlikely) - or_d - User + 2FA with 90-day timeout - 3-of-3 that decays to 2-of-3 after 90 days - BOLT sipa#3: to_local revocation policy - BOLT sipa#3: simplified offered HTLC - BOLT sipa#3: received HTLC These tests validate graph structure, key name preservation, node connectivity, and proper handling of complex miniscript expressions used in real-world Bitcoin applications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi sipa!
Thanks for your excellent work on miniscript and this C++ implementation!
This is really important work so I decided to put some time into breaking it :-)
That has proven quite hard: the implementation seems to be very robust and well-written. I really like the modern C++ style.
Anyways, this is a small issue I found:
Before:
After: