Update ToPublicKey API to take in context param #166
Merged
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.
Although the diff is large, most of it just compiler guiding me on how to fix the errors. As can be seen from the diff the change is pretty invasive.
On the other hand, we can have the user use the translate functions to get a
Miniscript<bitcoin::PublicKey, _>and then use the API operations on those. Considering the API changes required here, I am leaning toward the other option of not implementingToPublicKeyto DescriptorKey at all. Even for tweaked keys where we need cryptographic operations, we should use the translate functions.I am starting to think that having additional parameters for address, max_satisfaction_wieght, etc might not be worth it.
Does not currently build/test for compiler feature. I can fix that depending on what we decide.
w.r.t #163, I think the best way to not implement
ToPublicKeyat all and have users use the translate function to get aMiniscript<bitcoin::PublicKey, _>. We can even provide a simple utility function that does it incase the user finds it hard to use thetraslate_pkfunction.@apoelstra What do you think?