-
Notifications
You must be signed in to change notification settings - Fork 141
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
Add the "planning" module #481
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a238673
Add relative and absolute timelock in Satisfaction
afilini 95edba5
Add full_derivation_paths on DescriptorPublicKey
danielabrozzoni 75ed631
Add plan capabilities to miniscript
afilini c434fa7
tests: plan capabilities
danielabrozzoni 64cce2e
test: absolute/relative timelocks in satisfaction
danielabrozzoni 4849893
Fix test_cpp
sanket1729 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definition is a little awkward because it doesn't include all parents. It seems you added it as part of applying a policy where
A
is not a parent ofA/1
butA/*
is in the asset code. Don't we usually want to express the policy where I haveA
and am willing to sign anything under it e.g.A/2/7
andA
andA/1
etc. By returning a full derivation path it also implies there might be multiple items in the path but this function only returns a derivation path with one item.If this function is indeed useful how about rename it to
derivation_index_for
where it just return anOption<u32>
i.e. it returns the value that could be passed toat_derivation_index
to get theDefiniteDescriptorKey
if it exists (a sort of inverse function).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this just needs a better name, essentially what I'm trying to figure out is whether a
DefiniteDescriptorKey
is a derivation of a givenDescriptorPublicKey
, which can only extend the path by one item (multiple wildcards are not supported).I like your suggestion of naming it
derivation_index_for
, but I thinkOption<u32>
is not a great return type because in case theDescriptorPublicKey
doesn't have a wildcard we need to still return a positive "match" result but we don't have a derivation index.I guess I could add an enum for this specifically, with two variants:
Wildcard(bip32::ChildNumber)
andNonWildcard
or something like this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of 4849893 this is still TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6151612 in #592 removes the method altogether