Introduce Extension trait#13
Merged
Merged
Conversation
Member
|
Does this have any upstream dependencies, or is it ready to review (and theoretically merge) now? |
Contributor
Author
|
This is ready for merge after review |
apoelstra
reviewed
Oct 27, 2021
| Terminal::True => Semantic::Trivial, | ||
| Terminal::False => Semantic::Unsatisfiable, | ||
| Terminal::Version(_) | Terminal::OutputsPref(_) => return Err(CovError::CovenantLift)?, | ||
| // Terminal::Version(_) | Terminal::OutputsPref(_) => return Err(CovError::CovenantLift)?, |
Member
There was a problem hiding this comment.
my onliy nit is tha tthis should be deleted rather than commented out
apoelstra
approved these changes
Oct 27, 2021
Member
|
To check my understanding:
I have a few followups that I'd like to add but I will PR them myself. |
Member
|
@sanket1729 I recall asking if we could upstream this, and you said roughly "no, I think it would be too invasive". But I'm not sure it would be. |
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.
Complete refactor of the library to support extensions. This introduces an
Extensiontrait that be implemented by downstream libraries to add new leaf fragments to miniscripts. The trait asks user to provide type properties about the fragment, satisfaction logic, script costs, parsing(to and fro from script/string) logic, consensus checks, as well the interpreter API.Not all script fragments can be easily converted into miniscript leaf fragments. In other words, the implementer of this trait should take care that fragments can be parsed unambiguously without conflicting with existing fragments/extensions.
All the library APIs(descriptors, interpreter) should work seamlessly once
Extensiontrait is implemented. This PR also refactors the currently supportedver_eqandoutputs_prefas extensions.It should also be possible to extend the trait to support the compiler feature, but that is left as a todo for now.
Fixes #11 .