Drop deprecated use of PrivateKey methods
What changed, and why it matters
This commit updates a test file to use newer, non-deprecated method names for private key operations. It is a routine code cleanup with no security relevance.
No action required. This is a benign test-only refactoring.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit replaces two deprecated API calls in bitcoin/tests/bip_174.rs: PrivateKey::to_bytes() is replaced with to_secret_vec(), and PrivateKey::public_key() is replaced with to_public_key(). Both replacements are semantically equivalent and only affect test code. There is no functional or security change.
Changed components
bitcoin/tests/bip_174.rsInspect captured patch +2 / −2
diff --git a/bitcoin/tests/bip_174.rs b/bitcoin/tests/bip_174.rs
index 175cf009..c5e8bfee 100644
--- a/bitcoin/tests/bip_174.rs
+++ b/bitcoin/tests/bip_174.rs
@@ -119,7 +119,7 @@ fn build_extended_private_key() -> Xpriv {
let xpriv = extended_private_key.parse::<Xpriv>().unwrap();
let sk = WifKey::from_wif(seed).unwrap();
- let seeded = Xpriv::new_master(NetworkKind::Test, &sk.private_key.to_bytes());
+ let seeded = Xpriv::new_master(NetworkKind::Test, &sk.private_key.to_secret_vec());
assert_eq!(xpriv, seeded);
xpriv
@@ -315,7 +315,7 @@ fn parse_and_verify_keys(
let derived_priv =
ext_priv.derive_xpriv(&path).expect("derivation path too long").to_private_key();
assert_eq!(wif_priv.private_key, derived_priv);
- let derived_pub = derived_priv.public_key();
+ let derived_pub = derived_priv.to_public_key();
key_map.insert(derived_pub, derived_priv);
}
key_map
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.