Commit 39d488b
committed
Merge rust-bitcoin#5342: Depend on primitives instead of bitcoin where type definitions overlap
c97d458 Add re-export for primitives to Bitcoin crate (yancy)
f81e8d2 Depend on primitives instead of bitcoin where type definitions overlap (yancy)
Pull request description:
Consolidate dependency tree for downstream crates that depend on `bitcoin-p2p-messages` by reducing overlapping dependencies. For example, consider crate A which depends on `bitcoin-primitives` and `bitcoin-p2p-messages`. For types defined by both `bitcoin-primitives` and `bitcoin`, Crate A may still need to depend on `bitcoin` if a type of `bitcoin-p2p-messages` depends on `bitcoin` instead of `bitcoin-primitives`.
Also, see: rust-bitcoin#5331
_After_ this change, the remaining bitcoin dependencies are:
```
examples/handshake.rs:6:use bitcoin::consensus::{encode, Decodable};
src/address.rs:15:use bitcoin::consensus::encode::{self, Decodable, Encodable, ReadExt, WriteExt};
src/address.rs:532: use bitcoin::consensus::encode::{deserialize, serialize};
src/consensus.rs:2:use bitcoin::consensus::encode::WriteExt;
src/lib.rs:43:use bitcoin::consensus::encode::{self, Decodable, Encodable};
src/lib.rs:44:use bitcoin::network::{Network, Params, TestnetVersion};
src/lib.rs:489: use bitcoin::consensus::encode::{deserialize, serialize};
src/message.rs:17:use bitcoin::block::HeaderExt;
src/message.rs:18:use bitcoin::consensus::encode::{self, Decodable, Encodable, ReadExt, WriteExt};
src/message.rs:19:use bitcoin::merkle_tree::MerkleBlock;
src/message.rs:959: use bitcoin::bip152::BlockTransactionsRequest;
src/message.rs:960: use bitcoin::bip158::{FilterHash, FilterHeader};
src/message.rs:962: use bitcoin::consensus::encode::{deserialize, deserialize_partial, serialize};
src/message_blockdata.rs:13:use bitcoin::consensus::encode::{self, Decodable, Encodable};
src/message_blockdata.rs:175: use bitcoin::consensus::encode::{deserialize, serialize};
src/message_bloom.rs:11:use bitcoin::consensus::{encode, Decodable, Encodable, ReadExt};
src/message_compact_blocks.rs:8:use bitcoin::bip152;
src/message_filter.rs:11:use bitcoin::bip158::{FilterHash, FilterHeader};
src/message_network.rs:15:use bitcoin::consensus::{encode, Decodable, Encodable, ReadExt, WriteExt};
src/message_network.rs:420: use bitcoin::consensus::encode::{deserialize, serialize};
src/network_ext.rs:7:use bitcoin::{Network, TestnetVersion};
```
I've left bip152 and bip158 for future PRs (rust-bitcoin#5333). I don't think any of the remaining dependencies can be readily moved.
ACKs for top commit:
apoelstra:
ACK c97d458; successfully ran local tests
tcharding:
ACK c97d458
Tree-SHA512: 389eb09d8b3a75de0cb30baa3722c9e7b03273dfb8547211246349e97ab205c66354aaed2a49415faf6e01fef41a496d114fb68869355f95778f69e2346bb8c6File tree
7 files changed
+13
-7
lines changed- bitcoin/src
- p2p
- src
7 files changed
+13
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | 81 | | |
79 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | | - | |
| 1663 | + | |
1664 | 1664 | | |
1665 | | - | |
| 1665 | + | |
1666 | 1666 | | |
1667 | 1667 | | |
1668 | 1668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments