forked from rust-bitcoin/rust-miniscript
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge rust-bitcoin#733: Remove
TranslatePk
trait and clean up `Tran…
…slator` trait 36b0659 translator: make target pk and error associated types (Andrew Poelstra) c330d0b remove the TranslatePk trait (Andrew Poelstra) 6e1d6bb descriptor: stop using TranslatePk in mod.rs (Andrew Poelstra) b80296b descriptor: stop using TranslatePk in tr.rs (Andrew Poelstra) f89cf25 descriptor: stop using TranslatePk in sh.rs (Andrew Poelstra) 4654b98 descriptor: stop using TranslatePk in segwitv0.rs (Andrew Poelstra) 9c91586 descriptor: stop using TranslatePk in bare.rs (Andrew Poelstra) e73a141 miniscript: stop using TranslatePk (Andrew Poelstra) Pull request description: This may be too much of a breaking change and an instance of rust-bitcoin/rust-bitcoin#3166, but the existing traits are *really* annoying to use. But this change is not essential to any of my other work so feel free to concept NACK it. There are two changes here: * This drops the `TranslatePk` trait which had no business existing. It attempts to be generic over "things whose keys can be translated", but is missing impls (on keys themselves, for example) and anyway it is basically impossible to usefully be generic over this trait since it has an associated `Output` type which is unconstrained except by a comment saying "this must be `Self<Q>`. Really, the only purpose of this trait is to force users to write `use miniscript::TranslatePk` every time they want access to the `translate_pk` method. * It moves two of the generics in `Translator` from generics to associated types. This makes it far more ergonomic to implement and require the trait, since you no longer need to write 3 separate generics everywhere when two are implied. (Actually, all three are implied, including the source `Pk` type, but in practice users want to constrain this to match an existing key type that they've got. So I left it as a generic rather than an associated type.) ACKs for top commit: sanket1729: ACK 36b0659 Tree-SHA512: 0f7989925af2f9857146eb00e41a81ec1bbaf4c94b0003230835d3979ccb7913d8c958f1293f501e36ddcbaf81e8a88ada261371d9b79c4c85fec3ee195ffc07
- Loading branch information
Showing
18 changed files
with
278 additions
and
285 deletions.
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
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.