-
Notifications
You must be signed in to change notification settings - Fork 154
Remove MiniscriptKey
associated hash types
#600
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
Remove MiniscriptKey
associated hash types
#600
Conversation
Set `rustfmt` config option `fn_single_line` to true and run the formatter.
Set `rustfmt` config option `fn_call_width` to 80 and run the formatter.
Set `rustfmt` config option `struct_lit_width` to true and run the formatter.
What replaces these associated types? It looks like it forces the hash types to always use the |
Caveat: I'm only 1/4 of the way to understanding miniscript, if that and I don't fully grok what the At first I called the new type If that is the case my hunch was that |
How would you represent the placeholder for the hash of |
In the |
Store it where? Sorry to be so Socratic here -- my point is that we deliberately support having placeholders (or other custom types) for hashes just like we support placeholders for keys. |
Not at all! There are likely better uses of your time but if its interesting then the reason for my "hunch" that we could remove these and simplify the code is that we have 4 key types (bitcoin/secp pubkey, xonly, and string), 3 real keys and a "fake" one with hash types for the 3 being real again and the |
These are public traits. All of my uses of rust-miniscript involve implementing these traits for custom key types. And
Well, we used to have separate generics for all the hash types and the public keys, because conceptually these are all independent things. But having 5 generics on every type was a pretty awful burden on users of the codebase, so we moved them to associated types, which has been much nicer. |
ahhh, that changes things quite a lot. Thanks for being patient with me :) |
Done on top of #572 so just the last 3 patches.
This one seems too good to be true net 2000 lines of red in the diff! Raising as draft till I have another look at it tomorrow.
Remove the associated hash types from
MiniscriptKey
- epic!Please note: this was a whole bunch of wild hacking based on a hunch, now I've got tests passing locally I'm not sure we need the first two patches and the new
StringKey
type. Gotta run, no time to investigate CI fails.