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
Use new hex-conservative
crate
#1833
Use new hex-conservative
crate
#1833
Conversation
I think we should rename it to |
fb37f96 Rename HexIterator to Iter (Tobin C. Harding) Pull request description: A few observations: - The `HexIterator` is an adaptor iterator, iterating over a hex string yielding bytes. - The `HexIterator` is passed to a function called `from_bytes_iter`. - It is unlikely that we will ever have an adaptor iterator iterating over a bytes an yielding two hex digits. The name `Iter` seems like a good candidate, if re-exported at the crate root this allows usage as `hex::Iter::new("deadbeef")`. Rename `HexIterator` to `Iter` and re-export it at the crate root. Inspired by rust-bitcoin/rust-bitcoin#1833 (comment) ACKs for top commit: apoelstra: ACK fb37f96 Tree-SHA512: f201b42f93240a115ae5e96f753eaf16b49bd183b0838aabbb29156a513e305529d8ebc2293621391d08838063495de15ee7d886ede9675adeef15658e703d56
25cbccc
to
926da09
Compare
Nice! This looks good now. |
Thanks man, looks sweet huh. |
926da09
to
80172f2
Compare
80172f2
to
43a8355
Compare
This will need the lock files updating still, hopefully #1916 will be in by then so msrv pinning stuff is resolved. |
I think we should do the hex stuff before any other releases. |
2403c0c
to
ae87bd6
Compare
Something is wrong with the git diff @~ hashes/Cargo.toml
diff --git a/hashes/Cargo.toml b/hashes/Cargo.toml
index 0516af97..ac8591b9 100644
--- a/hashes/Cargo.toml
+++ b/hashes/Cargo.toml
@@ -14,9 +14,10 @@ exclude = ["tests", "contrib"]
[features]
default = ["std"]
-std = ["alloc", "internals/std"]
-alloc = ["internals/alloc"]
+std = ["alloc", "internals/std", "hex/std"]
+alloc = ["internals/alloc", "hex/alloc"]
serde-std = ["serde/std"]
+core2 = ["actual-core2", "hex/core2"]
[package.metadata.docs.rs]
all-features = true
@@ -24,12 +25,15 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
internals = { path = "../internals", package = "bitcoin-internals", version = "0.1.0" }
+hex = { package = "hex-conservative", version = "0.1.0", default-features = false }
-core2 = { version = "0.3.0", default_features = false, optional = true }
schemars = { version = "0.8.3", optional = true }
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
serde = { version = "1.0", default-features = false, optional = true }
+# Do NOT use this feature! Use the `core2` feature instead.
+actual-core2 = { package = "core2", version = "0.3.0", default-features = false, optional = true }
+ |
ae87bd6
to
6a8ee6c
Compare
@tcharding did you update Cargo-recent.lock and Cargo-minimal.lock after making those changes to Cargo.toml? |
Yeah I did, I couldn't get |
6813ac1
to
91583ad
Compare
FTR the solution was extern crate actual_core2 as core2; But yesterday I hade |
91583ad
to
8c2ee72
Compare
Awesome, glad CI is passing. I'm temped though to get hex-conservative 0.1.1 out first (with the new |
Agree, mind if I call it v0.2.0? I've given up understanding Rust semver rules for under v1.0, just feels too trivial increasing only the patch number :) |
8c2ee72
to
bd8a74b
Compare
LGTM. May be a bit easier to review split into multiple commits, one for each crate, and a final one which deletes the hex stuff from -internals. |
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.
ACK bd8a74b
Can do! |
I had a go but we can't split it up without removing the workspace patch of |
bd8a74b
to
d395e11
Compare
I pulled the |
d395e11
to
1585f9c
Compare
We do not expect users of `rust-bitcoin` to ever activate the "core2" dependency directly, add a comment explaining that.
1585f9c
to
7b4f806
Compare
And I removed the unnecessary |
We have just released the `hex-conservative` crate, we can now use it. Do the following: - Depend on `hex-conservative` in `bitcoin` and `hashes` - Re-export `hex-conservative` as `hex` from both crate roots. - Remove all the old hex code from `hashes` - Fix all the import statements (makes up the bulk of the lines changed in this patch)
Remove the now unused `hex` module from internals, this functionality is now provided by the `hex-conservative` crate.
7b4f806
to
bb8bd16
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.
ACK bb8bd16
Draft because we may be able to make the |
The hex lib rename thing got closed so this is good to go. |
@sanket1729 would you mind taking a look at this if you get a chance please? The green in the diff is almost all import statements and error type renames. The red is 1000+ lines of mostly removing all the stuff that has been released already in One thing stand out as non-obvious, the implementation of Thanks man. |
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.
utACK bb8bd16
Oh my goodness we can merge this now, this has been a loooooong time coming :) |
Use the newly released
hex-conservative
crate, by doing the following:hex-conservative
inbitcoin
andhashes
hex-conservative
ashex
from both crate roots.hashes
internals
internals::prelude