Commit e7d9d44
committed
Merge #250: feat!: use
881df71 chore: rename `merge_network_kinds` to `intersect_network_kinds` (Luis Schwab)
fdb9d13 fix: GeneratableKey options for PrivateKey, Xpriv (valued mammal)
b1d384f feat!(examples,test): use `NetworkKind` (Luis Schwab)
944274a feat!(wallet): use `NetworkKind` (Luis Schwab)
c22aa13 feat!(keys): use `NetworkKind` (Luis Schwab)
ade83b4 feat!(descriptor): use `NetworkKind` (Luis Schwab)
Pull request description:
### Description
Closes #22.
Closes #94.
This PR replaces `bitcoin::Network` for `bitcoin::NetworkKind` where it applies.
I also took the liberty of fixing up and adding comments on the files I touched.
### Changelog
- `wallet_name_from_descriptor()` takes `NetworkKind` instead of `Network`.
- `DescriptorToExtract` takes `NetworkKind` instead of `Network`.
- `impl IntoWalletDescriptor for <T>` takes `Network` instead `NetworkKind`.
- `DescriptorTemplate::build()` takes `NetworkKind` instead of `Network`.
- `ExtendedKey::into_xprv()` takes `NetworkKind` instead of `Network`.
- `ExtendedKey::into_xpub()` takes `NetworkKind` instead of `Network`.
- `DerivableKey::into_extended_key()` examples updated to use `NetworkKind` instead of `Network`.
- `any_network()` renamed to `any_network_kind()`.
- `mainnet_network()` renamed to `mainnet_network_kind()`.
- `test_networks()` renamed to `test_network_kind()`.
- `merge_networks()` renamed to `intersect_network_kinds()`.
- `ValidNetworks` type alias renamed to `ValidNetworkKinds`.
- `GeneratedKey::new()` takes `ValidNetworkKinds` instead of `ValidNetworks`.
- `DescriptorKey::from_public()` takes `ValidNetworkKinds` instead of `ValidNetworks`.
- `DescriptorKey::from_secret()` takes `ValidNetworkKinds` instead of `ValidNetworks`.
- `KeyError::InvalidNetwork` renamed to `KeyError::InvalidNetworkKind`.
- `DescriptorKey::override_valid_networks()` renamed to `override_valid_network_kinds()`.
- Network validation logic updated to use `NetworkKind` instead of `Network`.
- Test network validation now uses `NetworkKind::Test` instead of `Network::{Regtest, Signet, Testnet, Testnet4}`.
- Examples and comments updated to use `NetworkKind` instead of `Network`.
### Checklists
#### All Submissions:
* [X] I've signed all my commits
* [X] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
* [X] I ran `cargo +nightly fmt` and `cargo clippy` before committing
#### New Features:
* [ ] I've added tests for the new feature
* [X] I've added docs for the new feature
#### Bugfixes:
* [X] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [X] I'm linking the issue being fixed by this PR
ACKs for top commit:
ValuedMammal:
ACK 881df71
oleonardolima:
ACK 881df71
Tree-SHA512: 9da33233db1409764d75fd688c8343f01c624b359df389acbafbab818114b2ffb1d0f1a977ff60ff5f850b8d8de4b74827360a4740954c0d751ce5a60d1cc5afNetworkKind
File tree
13 files changed
+818
-669
lines changed- examples
- src
- descriptor
- keys
- wallet
- tests
13 files changed
+818
-669
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | | - | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
0 commit comments