-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
miniscript: add an unit test for substitute_raw_pkh() #729
Open
pythcoiner
wants to merge
8
commits into
rust-bitcoin:master
Choose a base branch
from
pythcoiner:substitute_raw_pkh
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Commits on Aug 19, 2024
-
types: clean up some error messages
There were accidental newlines in some error messages.
Configuration menu - View commit details
-
Copy full SHA for 1b49a39 - Browse repository at this point
Copy the full SHA 1b49a39View commit details
Commits on Aug 20, 2024
-
policy: stop using duplicate keys in unit tests
We will want to start rejecting duplicate keys in policy. Currently they are rejected in the compiler and when parsing (sane) Miniscripts and when calling `is_valid` on concrete policies, but NOT when lifting insane Miniscripts or when parsing concrete or semantic policies. Meanwhile, mixing timelocks is checked in all the above places EXCEPT when parsing concrete or semantic policies. And of course, neither is checked when directly constructing Miniscripts or policies. It's all very inconsistent. My eventual goal is to use the same set of "sane" checks everywhere. To do this, I will need to embed a set of checks into Miniscript objects, and then later do the same with Policy objects (which will need to stop being "bare recursive structs" and start having more structure, same as Miniscript).
Configuration menu - View commit details
-
Copy full SHA for ff0509f - Browse repository at this point
Copy the full SHA ff0509fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7bb9b04 - Browse repository at this point
Copy the full SHA 7bb9b04View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5da250a - Browse repository at this point
Copy the full SHA 5da250aView commit details -
iter: introduce right-to-left post-order iterator, use throughout cod…
…ebase We have several algorithms throughout the codebase which "translate" a recursive object by running a post-order iterator over it, building a modified copy node-by-node. We frequently do this by iterating over an Arc structure, pushing each created node onto a stack, and then using the `child_indices` member of the `PostOrderIterItem` struct to index into the stack. We copy elements out of the stack using Arc::clone and then push a new element. The result is that for an object with N nodes, we construct a stack with N elements, call Arc::clone N-1 times, and often we need to bend over backward to turn &self into an Arc<Self> before starting. There is a much more efficient way: with a post-order iterator, each node appears directly after its children. So we can just pop children off of the stack, construct the new node, and push that onto the stack. As long as we always pop all of the children, our stack will never grow beyond the depth of the object in question, and we can avoid some Arc::clones. Using a right-to-left iterator means that we can call .pop() in the "natural" way rather than having to muck about reordering the children. This commit converts every single use of post_order_iter in the library to use this new algorithm. In the case of Miniscript::substitute_raw_pkh, the old algorithm was actually completely wrong. The next commit adds a unit test.
Configuration menu - View commit details
-
Copy full SHA for e31d52b - Browse repository at this point
Copy the full SHA e31d52bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 44e0550 - Browse repository at this point
Copy the full SHA 44e0550View commit details -
policy: make lifting algorithm non-recursive, remove Liftable for Ter…
…minal It doesn't really make conceptual sense that Terminal would be Liftable. Terminal itself has no meaning; it isn't even typechecked. The recursive algorithm also repeats a lot of checks unnecessarily. Better to just call lift_check() once at the start of a Miniscript lift.
Configuration menu - View commit details
-
Copy full SHA for 8e2d90c - Browse repository at this point
Copy the full SHA 8e2d90cView commit details
Commits on Aug 26, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6ebf973 - Browse repository at this point
Copy the full SHA 6ebf973View commit details
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.