Use KnowHrp instead of Network#2387
Conversation
We have a bunch of functions that take `Network` when what they really want is something that can be converted to a `KnownHrp`. Make `KnownHrp` public and accept `impl Into<KnownHrp>`.
Pull Request Test Coverage Report for Build 7621632788
💛 - Coveralls |
| .parse::<CompressedPublicKey>() | ||
| .unwrap(); | ||
| let addr = Address::p2wpkh(&key, Bitcoin); | ||
| let addr = Address::p2wpkh(&key, KnownHrp::Mainnet); |
There was a problem hiding this comment.
IMO these tests could've stayed but whatever...
There was a problem hiding this comment.
Oh, you are right. I did the change before I used impl Into.
|
Note that I've just realized we'll have to make |
HRPs are an integral part of bech32. Where else could they belong to? |
Something like |
|
As discussed rather extensively on #2225 I don't think we should do this. Users being forced to move between two different |
|
This has nothing to do with #2225 but funnily enough it adds argument for application-specific enums.
|
|
That, rather, implies |
|
Yes, it's a bug in signet but we're already screwed and have to live with what we have. The other possibilities are remove |
We have a bunch of functions that take
Networkwhen what they really want is something that can be converted to aKnownHrp.Make
KnownHrppublic and acceptimpl Into<KnownHrp>.