From 2407f241e4dd165b122f3776fe40beb3dfd3b817 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Mon, 23 Jan 2023 13:57:30 +1100 Subject: [PATCH] Remove sep256k1 path from Parity The `Parity` type is unambiguous, no need to use the `secp256k1` path all the time just import the type. Refactor only, no logic changes. --- bitcoin/src/crypto/schnorr.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bitcoin/src/crypto/schnorr.rs b/bitcoin/src/crypto/schnorr.rs index 8e0addc2..16b83e00 100644 --- a/bitcoin/src/crypto/schnorr.rs +++ b/bitcoin/src/crypto/schnorr.rs @@ -11,7 +11,7 @@ use core::fmt; use bitcoin_internals::write_err; -pub use secp256k1::{self, constants, Secp256k1, KeyPair, XOnlyPublicKey, Verification}; +pub use secp256k1::{self, constants, Secp256k1, KeyPair, XOnlyPublicKey, Verification, Parity}; use crate::prelude::*; @@ -79,7 +79,7 @@ pub trait TapTweak { } impl TapTweak for UntweakedPublicKey { - type TweakedAux = (TweakedPublicKey, secp256k1::Parity); + type TweakedAux = (TweakedPublicKey, Parity); type TweakedKey = TweakedPublicKey; /// Tweaks an untweaked public key with corresponding public key value and optional script tree @@ -94,7 +94,7 @@ impl TapTweak for UntweakedPublicKey { /// /// # Returns /// The tweaked key and its parity. - fn tap_tweak(self, secp: &Secp256k1, merkle_root: Option) -> (TweakedPublicKey, secp256k1::Parity) { + fn tap_tweak(self, secp: &Secp256k1, merkle_root: Option) -> (TweakedPublicKey, Parity) { let tweak = TapTweakHash::from_key_and_tweak(self, merkle_root).to_scalar(); let (output_key, parity) = self.add_tweak(secp, &tweak).expect("Tap tweak failed");