-
Notifications
You must be signed in to change notification settings - Fork 831
Export some dependencies #289
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
Conversation
Users will have trouble with multiple versions of secp256k1 regardless, until we figure out how to version the C symbols, but concept ACK. Can you also export |
Concept ACK, after a brief glance there doesn't seem to be a way to transitively use dependencies in rust, so I suspect this will be useful. |
Since I originally opened #288, I think this might be useful: There is one pitfall that might be worth considering. If we re-export a whole crate, that crate's public API becomes part of A different approach, that doesn't eliminate all of those breaking changes but some, would be to selectively re-export the types we want. For example (to mimic the "old" API): extern crate bitcoin_hashes;
pub mod hashes {
pub use bitcoin_hashes::hash160::Hash as Hash160;
} Obviously, if there are now breaking changes to |
@thomaseizinger Breaking changes to bitcoin_hashes are breaking changes to rust-bitcoin anyway, because e.g. |
In principle (by using the dtolnay semver trick) there could be a major version bump to bitcoin_hashes that wouldn't affect rust-bitcoin users, but in practice the semver trick has not been available to us. |
455b06e
to
d9d7e8d
Compare
rebased |
d9d7e8d
to
88525ea
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You missed a place :-)
diff --git a/src/util/bip158.rs b/src/util/bip158.rs
index 30aee13..ac517dd 100644
--- a/src/util/bip158.rs
+++ b/src/util/bip158.rs
@@ -50,7 +50,7 @@ use std::error;
use std::fmt::{Display, Formatter};
use std::io::Cursor;
-use bitcoin_hashes::{Hash, sha256d, siphash24};
+use hashes::{Hash, sha256d, siphash24};
use byteorder::{ByteOrder, LittleEndian};
use blockdata::block::Block;
Otherwise, good change overall.
To other reviewers: I was concerned that users of our API would be confused that there existed a hashes
crate we were using, but upon cargo doc --open
I can see that pub extern crate bitcoin_hashes as hashes;
is right there on the front page. So, all good!
True. But I envision users that only want |
88525ea
to
3efd3e6
Compare
travis failed because of #300 which appears to be an unrelated bug. You can just kick it and it should be ok. |
Kicked |
Needs rebase |
3efd3e6
to
4097b69
Compare
Rebased |
4097b69
to
41f9b7a
Compare
Codecov Report
@@ Coverage Diff @@
## master #289 +/- ##
=======================================
Coverage 81.85% 81.85%
=======================================
Files 38 38
Lines 6951 6951
=======================================
Hits 5690 5690
Misses 1261 1261
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix the two instances of bitcoin_hashes
here:
I will approve and merge after.
Hmm, I left them on purpose tbh. But I can fix them. I'll rename them to bitcoin::hashes then, is that ok? Hashes itself doesn't mean anything outside this crate. |
41f9b7a
to
3cb8cc2
Compare
Done.
…On Fri, Aug 16, 2019 at 2:45 PM Carl Dong ***@***.***> wrote:
***@***.**** requested changes on this pull request.
Nit: please fix the two instances of bitcoin_hashes here:
https://github.com/rust-bitcoin/rust-bitcoin/pull/289/files#diff-ca925ea633ee82c8b9dfd44534146107R575-R578
I will approve and merge after.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#289?email_source=notifications&email_token=AAGQLXFAM2A2B3U73PXA4QDQE2VPTA5CNFSM4H6TOVIKYY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCBZMTBY#pullrequestreview-275958151>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAGQLXFIYKJYCGX4F2JSH7TQE2VPTANCNFSM4H6TOVIA>
.
|
3cb8cc2
to
42c3fbc
Compare
In retrospect, it's an internal macro. I changed it to just |
42c3fbc
to
c011727
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested-ACK c011727
This export
bitcoin_hashes
asbitcoin::hashes
andsecp256k1
asbitcoin::secp256k1
.This would mean that users of rust-bitcoin, (1) don't have to manually import those dependencies anymore and more importantly (2) can avoid certain dependency imcompatibility issues if some other module they use is using another version of
bitcoin_hashes
orsecp256k1
.Solves #288.