What changed, and why it matters
This commit simply swaps one internal test-only helper crate for another. It changes how test code converts hex strings into byte arrays, with no effect on the actual library users run in production. There is no security issue here.
No security action needed. Treat as routine dependency cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit replaces the hex-conservative dev-dependency with hex_lit in the base58 crate. The only code change is in base58/src/lib.rs tests: Vec::from_hex(...).unwrap() is replaced by the hex!(...) macro, and the assertion is adjusted to compare slices. This is a build/test hygiene change; it does not alter runtime behavior, public APIs, or cryptographic operations.
Changed components
base58/Cargo.tomlbase58/src/lib.rs (test module only)Cargo-minimal.lockCargo-recent.lockInspect captured patch +7 / −7
diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock
index 06fb6646..7675f08a 100644
--- a/Cargo-minimal.lock
+++ b/Cargo-minimal.lock
@@ -20,7 +20,7 @@ version = "0.2.0"
dependencies = [
"bitcoin-internals",
"bitcoin_hashes 0.16.0",
- "hex-conservative 0.3.0",
+ "hex_lit",
]
[[package]]
diff --git a/Cargo-recent.lock b/Cargo-recent.lock
index 0953c57d..0bd4f4dd 100644
--- a/Cargo-recent.lock
+++ b/Cargo-recent.lock
@@ -20,7 +20,7 @@ version = "0.2.0"
dependencies = [
"bitcoin-internals",
"bitcoin_hashes 0.16.0",
- "hex-conservative 0.3.0",
+ "hex_lit",
]
[[package]]
diff --git a/base58/Cargo.toml b/base58/Cargo.toml
index 7a64cf5a..105bf0c1 100644
--- a/base58/Cargo.toml
+++ b/base58/Cargo.toml
@@ -22,7 +22,7 @@ hashes = { package = "bitcoin_hashes", path = "../hashes", default-features = fa
internals = { package = "bitcoin-internals", path = "../internals" }
[dev-dependencies]
-hex = { package = "hex-conservative", version = "0.3.0", default-features = false, features = ["alloc"] }
+hex_lit = "0.1.1"
[package.metadata.docs.rs]
all-features = true
diff --git a/base58/src/lib.rs b/base58/src/lib.rs
index be1026fb..82c34805 100644
--- a/base58/src/lib.rs
+++ b/base58/src/lib.rs
@@ -253,7 +253,7 @@ where
mod tests {
use alloc::vec;
- use hex::FromHex as _;
+ use hex_lit::hex;
use super::*;
@@ -282,7 +282,7 @@ mod tests {
assert_eq!(&res, exp);
// Addresses
- let addr = Vec::from_hex("00f8917303bfa8ef24f292e8fa1419b20460ba064d").unwrap();
+ let addr = hex!("00f8917303bfa8ef24f292e8fa1419b20460ba064d");
assert_eq!(&encode_check(&addr[..]), "1PfJpZsjreyVrqeoAfabrRwwjQyoSQMmHH");
}
@@ -300,8 +300,8 @@ mod tests {
// Addresses
assert_eq!(
- decode_check("1PfJpZsjreyVrqeoAfabrRwwjQyoSQMmHH").ok(),
- Some(Vec::from_hex("00f8917303bfa8ef24f292e8fa1419b20460ba064d").unwrap())
+ decode_check("1PfJpZsjreyVrqeoAfabrRwwjQyoSQMmHH").ok().unwrap().as_slice(),
+ hex!("00f8917303bfa8ef24f292e8fa1419b20460ba064d")
);
// Non Base58 char.
assert_eq!(decode("¢").unwrap_err(), InvalidCharacterError::new(194));
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.