Remove all p2p dependency from network - #4565
Conversation
|
🚨 API BREAKING CHANGE DETECTED To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section. |
Kixunil
left a comment
There was a problem hiding this comment.
NACK removing the conversions.
These conversions are critical for network-agnostic applications (e.g. Firefish) and removing them is a breakage that cannot be worked around downstream.
We need a different approach: separate Network into a crate (I think bitcoincore-basic-api would be an appropriate name) and implement the conversions there.
You can still use |
|
Oh, yes, but why remove the conversions then? Presumably |
Pull Request Test Coverage Report for Build 15326023324Details
💛 - Coveralls |
|
This is preparation for splitting the |
|
|
The thing is, they are perhaps on the same level technically but if |
|
Code that converts it uses the The types are not on the same level technically -- |
|
Needs rebase. |
608736f to
0332083
Compare
|
🚨 API BREAKING CHANGE DETECTED To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section. |
Motivated by moving the `p2p` module to its own crate. `TryFrom` and `From` are already implement for converting to and from `Network`/`Magic`. The methods related to `Magic` are removed from `Network`, as well as any reference to `p2p` in the documentation, as `bitcoin` would no longer depend on `p2p`. The deser roundtrip test are relocated to `p2p/mod.rs`
0332083 to
cbe04b0
Compare
|
🚨 API BREAKING CHANGE DETECTED To see the changes click details on "Check semver breaks / PR Semver - stable toolchain" job then expand "Run semver checker script" and scroll to the end of the section. |
Dismissing review -- your initial complaint, that there was no workaround, was untrue because there are still From/TryFrom conversions (and also these methods can be implemented entirely outside the library if somebody wants). Your secondary complaint, that there was no reason to remove them since Network depends on Magic, is also untrue; the dependency runs the opposite direction, which is the reason for this PR in the first place.
Motivated by moving the
p2pmodule to its own crate.TryFromandFromare already implement for converting to and fromNetwork/Magic. The methods related toMagicare removed fromNetwork, as well as any reference top2pin the documentation, asbitcoinwould no longer depend onp2p.The deser roundtrip test are relocated to
p2p/mod.rs