-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #725: Eliminate more recursion, and Liftable impl for Terminal
8e2d90c policy: make lifting algorithm non-recursive, remove Liftable for Terminal (Andrew Poelstra) 44e0550 miniscript: add unit test for substitute_raw_pkh (Andrew Poelstra) e31d52b iter: introduce right-to-left post-order iterator, use throughout codebase (Andrew Poelstra) 5da250a miniscript: add unit test for repeated pubkeys (Andrew Poelstra) 7bb9b04 miniscript: add unit test for timelock mixing (Andrew Poelstra) ff0509f policy: stop using duplicate keys in unit tests (Andrew Poelstra) 1b49a39 types: clean up some error messages (Andrew Poelstra) Pull request description: This PR does a few things which are mostly related: * Adds unit tests and does a couple cleanups. * Introduces a new right-to-left post-order iterator and uses that to eliminate a bunch of Arc::clones and extra memory usage from existing non-recursive algorithms * Fixes a bug in `Miniscript::substitute_raw_pkh` where the function completely didn't work (this fell out of the right-to-left change) * Converts `Miniscript::lift` to be non-recursive * Eleminates `Terminal::lift` because this impl is conceptually confused (`Terminal` as a type should never be used except to construct `Miniscript`s; they are not typechecked or sanity-checked and have no capacity to store type information). It was originally implemented as a convenience to help the `Miniscript` implementation but we don't need it now It also stops using duplicate keys in a couple unit tests. Right now our "sanity checking" logic for things like duplicate keys is super ad-hoc and inconsistent. For example, the duplicate-key check is implemented three times (in miniscript::analyzable, policy::semantic and policy::concrete) and the check is actually done in somewhat-random places. This PR doesn't change that, but since I was touching unit tests I figured I'd clean it up. ACKs for top commit: sanket1729: ACK 8e2d90c Tree-SHA512: 55edb0b8ac055215d4f733b663a8b5279aa53d360f17bf9034be00f9d30f0329eaa58faae34446c4f739241ee53b7b4d36127f4cc2dacf7c9e49a57feab292f0
- Loading branch information
Showing
6 changed files
with
326 additions
and
180 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.