Skip to content

Commit 93b4fb1

Browse files
committed
Use new Keypair API
Stop using deprecated API in favour of the new one.
1 parent 2918558 commit 93b4fb1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bitcoin/examples/taproot-psbt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ fn sign_psbt_taproot(
746746
sighash_type: TapSighashType,
747747
secp: &Secp256k1<secp256k1::All>,
748748
) {
749-
let keypair = secp256k1::Keypair::from_seckey_slice(secp, secret_key.as_ref()).unwrap();
749+
let keypair = secp256k1::Keypair::from_seckey_byte_array(secp, secret_key.secret_bytes()).unwrap();
750750
let keypair = match leaf_hash {
751751
None => keypair.tap_tweak(secp, psbt_input.tap_merkle_root).to_keypair(),
752752
Some(_) => keypair, // no tweak for script spend

bitcoin/src/bip32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ impl Xpriv {
745745
/// Constructs a new BIP-0340 keypair for Schnorr signatures and Taproot use matching the internal
746746
/// secret key representation.
747747
pub fn to_keypair<C: secp256k1::Signing>(self, secp: &Secp256k1<C>) -> Keypair {
748-
Keypair::from_seckey_slice(secp, &self.private_key[..])
748+
Keypair::from_seckey_byte_array(secp, self.private_key.secret_bytes())
749749
.expect("BIP-0032 internal private key representation is broken")
750750
}
751751

0 commit comments

Comments
 (0)