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.
This commit is contained in:
Tobin C. Harding 2023-01-23 13:57:30 +11:00
parent a43de831e4
commit 2407f241e4
1 changed files with 3 additions and 3 deletions

View File

@ -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<C: Verification>(self, secp: &Secp256k1<C>, merkle_root: Option<TapNodeHash>) -> (TweakedPublicKey, secp256k1::Parity) {
fn tap_tweak<C: Verification>(self, secp: &Secp256k1<C>, merkle_root: Option<TapNodeHash>) -> (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");