Skip to content

Commit 982d0e8

Browse files
committed
Use new Keypair API
Stop using deprecated API in favour of the new one.
1 parent ba629d9 commit 982d0e8

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
@@ -748,7 +748,7 @@ fn sign_psbt_taproot(
748748
sighash_type: TapSighashType,
749749
secp: &Secp256k1<secp256k1::All>,
750750
) {
751-
let keypair = secp256k1::Keypair::from_seckey_slice(secp, secret_key.as_ref()).unwrap();
751+
let keypair = secp256k1::Keypair::from_seckey_byte_array(secp, secret_key.secret_bytes()).unwrap();
752752
let keypair = match leaf_hash {
753753
None => keypair.tap_tweak(secp, psbt_input.tap_merkle_root).to_keypair(),
754754
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)