-
Notifications
You must be signed in to change notification settings - Fork 136
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
Move and rename crate::policy::semantic::Policy
to crate::r#abstract::Abstract
#604
Commits on Sep 27, 2023
-
Use wilcard import in unit tests
We can import types to test in unit tests using `use super::*`.
Configuration menu - View commit details
-
Copy full SHA for 0232152 - Browse repository at this point
Copy the full SHA 0232152View commit details -
Rename semantic module to abstract
We used "semantic" so as not to clash with the reserved Rust keyword "abstract", however there is a language feature to deal with such name clashes - the raw identifier syntax `r#foo`. Use `r#abstract` and rename the `policy/semantic.rs` file to `policy/abstract.rs`. There is more re-naming to do to complete the semantic -> abstract change but here we _only_ do the module name to ease review.
Configuration menu - View commit details
-
Copy full SHA for b3f55f6 - Browse repository at this point
Copy the full SHA b3f55f6View commit details -
Move Liftable to crate::abstract module
The `Liftable` trait is its own thing, it defines a trait to lift miniscript, descriptors, and concrete policies to an abstract policy. Move the `Liftable` and associated error type and impls to a new `lift` module that lives under the recently created `crate::r#abstract` module. Note we alse remove the `Semantic` and `Concrete` public re-names/re-exports from `crate::policy` because we are transitioning away from using the term "semantic", however to minimise the changes in this patch we add a bunch of `use crate::policy::concrete::Policy as Concrete` statements.
Configuration menu - View commit details
-
Copy full SHA for f00e538 - Browse repository at this point
Copy the full SHA f00e538View commit details -
Use Abstract instead of Semantic
We are moving away from the usage of "semantic" as a synonym for "abstract". Use `Abstract` instead of `Semantic` as the type alias for `crate::policy::r#abstract::Policy`.
Configuration menu - View commit details
-
Copy full SHA for 08ddb6c - Browse repository at this point
Copy the full SHA 08ddb6cView commit details -
Use Abstract type alias in Liftable for Tr
Make it explicit that the `Policy` returned by `lift` in the `descriptor::tr` module is a `r#abstract::Policy`.
Configuration menu - View commit details
-
Copy full SHA for 298e8d8 - Browse repository at this point
Copy the full SHA 298e8d8View commit details -
Move abstract::Policy to crate/abstract/mod.rs
The abstract policy is different from the concrete policy because it is only part of rust-miniscript and not miniscript in general. To help differentiate it move it to a separate module. Note to reviewers, `git` couldn't work out that this is basically a file move so I've left the `src/policy/abstract.rs` file in the repo but it is not included in the build. Reviewers can do `diff src/policy/abstract.rs src/abstract/mod.rs` to ease review. It will be removed in the next patch.
Configuration menu - View commit details
-
Copy full SHA for 463a41f - Browse repository at this point
Copy the full SHA 463a41fView commit details -
Remove unused abstract.rs file
We do not build this file in the build, remove it.
Configuration menu - View commit details
-
Copy full SHA for 70b2e5f - Browse repository at this point
Copy the full SHA 70b2e5fView commit details -
Rename abstract::Policy to Abstract
Use the identifier `Abstract` to further disambiguate the abstract policy and the concrete policy. This has the nice advantage of removing a few usages of the kind-of-ugly `r#abstract::Policy`.
Configuration menu - View commit details
-
Copy full SHA for b79be87 - Browse repository at this point
Copy the full SHA b79be87View commit details