Skip to content
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

Create the lift module #607

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tcharding
Copy link
Member

This is an alternative to #604 based on review suggestion.

Draft for feedback please.

In Rust, by convention, traits with a single method are named the same
as the method. `Liftable` should be called `Lift`, make it so.
Observe:

- The semantic/abstract policy is a rust-miniscript thing but the policy
  language (`concrete::Policy`) is a general miniscript thing.
- The `semantic::Policy` can be created by lifting more than just a
  concrete policy (eg, a descriptor).

Do the following:

- Move `src/policy/semantic.rs` to `src/lift/lifted.rs` (leaving the
  type as `Policy`).
- Move the contents of `src/policy/mod.rs` (excl. tests/benches) to
  `src/lift/mod.rs`.
- Add a re-export `lift::lifted::Policy as Lifted` and use it in other
  parts of the code base.

Note, the idea to keep the `lifted::Policy` as is and re-export helps
keep this patch smaller but also gives some choice to how the type is
used

- `use crate::lift::Liftded` coupled with usage of `Lifted`.
- `use crate::lift::lifted` coupled with usage of `lifted::Policy`

We can the do a rename later if deemed appropriate.
@apoelstra
Copy link
Member

I like this. @sanket1729 what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants