@@ -30,8 +30,8 @@ use crate::pset::map::Map;
3030use crate :: pset:: raw;
3131use crate :: pset:: serialize;
3232use crate :: pset:: { self , error, Error } ;
33- use crate :: { transaction:: SighashTypeParseError , SchnorrSigHashType } ;
34- use crate :: { AssetIssuance , BlockHash , EcdsaSigHashType , Script , Transaction , TxIn , TxOut , Txid } ;
33+ use crate :: { transaction:: SighashTypeParseError , SchnorrSighashType } ;
34+ use crate :: { AssetIssuance , BlockHash , EcdsaSighashType , Script , Transaction , TxIn , TxOut , Txid } ;
3535use bitcoin:: bip32:: KeySource ;
3636use bitcoin:: { PublicKey , key:: XOnlyPublicKey } ;
3737use secp256k1_zkp:: { self , RangeProof , Tweak , ZERO_TWEAK } ;
@@ -292,7 +292,7 @@ impl Default for Input {
292292}
293293
294294/// A Signature hash type for the corresponding input. As of taproot upgrade, the signature hash
295- /// type can be either [`EcdsaSigHashType `] or [`SchnorrSigHashType `] but it is not possible to know
295+ /// type can be either [`EcdsaSighashType `] or [`SchnorrSighashType `] but it is not possible to know
296296/// directly which signature hash type the user is dealing with. Therefore, the user is responsible
297297/// for converting to/from [`PsbtSighashType`] from/to the desired signature hash type they need.
298298#[ derive( Copy , Clone , Debug , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
@@ -305,7 +305,7 @@ serde_string_impl!(PsbtSighashType, "a PsbtSighashType data");
305305impl fmt:: Display for PsbtSighashType {
306306 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
307307 match self . schnorr_hash_ty ( ) {
308- Some ( SchnorrSigHashType :: Reserved ) | None => write ! ( f, "{:#x}" , self . inner) ,
308+ Some ( SchnorrSighashType :: Reserved ) | None => write ! ( f, "{:#x}" , self . inner) ,
309309 Some ( schnorr_hash_ty) => fmt:: Display :: fmt ( & schnorr_hash_ty, f) ,
310310 }
311311 }
@@ -321,8 +321,8 @@ impl FromStr for PsbtSighashType {
321321 // NB: some of Schnorr sighash types are non-standard for pre-taproot
322322 // inputs. We also do not support SIGHASH_RESERVED in verbatim form
323323 // ("0xFF" string should be used instead).
324- match SchnorrSigHashType :: from_str ( s) {
325- Ok ( SchnorrSigHashType :: Reserved ) => {
324+ match SchnorrSighashType :: from_str ( s) {
325+ Ok ( SchnorrSighashType :: Reserved ) => {
326326 return Err ( SighashTypeParseError {
327327 unrecognized : s. to_owned ( ) ,
328328 } )
@@ -341,36 +341,36 @@ impl FromStr for PsbtSighashType {
341341 } )
342342 }
343343}
344- impl From < EcdsaSigHashType > for PsbtSighashType {
345- fn from ( ecdsa_hash_ty : EcdsaSigHashType ) -> Self {
344+ impl From < EcdsaSighashType > for PsbtSighashType {
345+ fn from ( ecdsa_hash_ty : EcdsaSighashType ) -> Self {
346346 PsbtSighashType {
347347 inner : ecdsa_hash_ty as u32 ,
348348 }
349349 }
350350}
351351
352- impl From < SchnorrSigHashType > for PsbtSighashType {
353- fn from ( schnorr_hash_ty : SchnorrSigHashType ) -> Self {
352+ impl From < SchnorrSighashType > for PsbtSighashType {
353+ fn from ( schnorr_hash_ty : SchnorrSighashType ) -> Self {
354354 PsbtSighashType {
355355 inner : schnorr_hash_ty as u32 ,
356356 }
357357 }
358358}
359359
360360impl PsbtSighashType {
361- /// Returns the [`EcdsaSigHashType `] if the [`PsbtSighashType`] can be
361+ /// Returns the [`EcdsaSighashType `] if the [`PsbtSighashType`] can be
362362 /// converted to one.
363- pub fn ecdsa_hash_ty ( self ) -> Option < EcdsaSigHashType > {
364- EcdsaSigHashType :: from_standard ( self . inner ) . ok ( )
363+ pub fn ecdsa_hash_ty ( self ) -> Option < EcdsaSighashType > {
364+ EcdsaSighashType :: from_standard ( self . inner ) . ok ( )
365365 }
366366
367- /// Returns the [`SchnorrSigHashType `] if the [`PsbtSighashType`] can be
367+ /// Returns the [`SchnorrSighashType `] if the [`PsbtSighashType`] can be
368368 /// converted to one.
369- pub fn schnorr_hash_ty ( self ) -> Option < SchnorrSigHashType > {
369+ pub fn schnorr_hash_ty ( self ) -> Option < SchnorrSighashType > {
370370 if self . inner > 0xffu32 {
371371 None
372372 } else {
373- SchnorrSigHashType :: from_u8 ( self . inner as u8 )
373+ SchnorrSighashType :: from_u8 ( self . inner as u8 )
374374 }
375375 }
376376
@@ -390,28 +390,28 @@ impl PsbtSighashType {
390390}
391391
392392impl Input {
393- /// Obtains the [`EcdsaSigHashType `] for this input if one is specified. If no sighash type is
394- /// specified, returns [`EcdsaSigHashType ::All`].
393+ /// Obtains the [`EcdsaSighashType `] for this input if one is specified. If no sighash type is
394+ /// specified, returns [`EcdsaSighashType ::All`].
395395 ///
396396 /// # Errors
397397 ///
398398 /// If the `sighash_type` field is set to a non-standard ECDSA sighash value.
399- pub fn ecdsa_hash_ty ( & self ) -> Option < EcdsaSigHashType > {
399+ pub fn ecdsa_hash_ty ( & self ) -> Option < EcdsaSighashType > {
400400 self . sighash_type
401401 . map ( |sighash_type| sighash_type. ecdsa_hash_ty ( ) )
402- . unwrap_or ( Some ( EcdsaSigHashType :: All ) )
402+ . unwrap_or ( Some ( EcdsaSighashType :: All ) )
403403 }
404404
405- /// Obtains the [`SchnorrSigHashType `] for this input if one is specified. If no sighash type is
406- /// specified, returns [`SchnorrSigHashType ::Default`].
405+ /// Obtains the [`SchnorrSighashType `] for this input if one is specified. If no sighash type is
406+ /// specified, returns [`SchnorrSighashType ::Default`].
407407 ///
408408 /// # Errors
409409 ///
410410 /// If the `sighash_type` field is set to a invalid Schnorr sighash value.
411- pub fn schnorr_hash_ty ( & self ) -> Option < SchnorrSigHashType > {
411+ pub fn schnorr_hash_ty ( & self ) -> Option < SchnorrSighashType > {
412412 self . sighash_type
413413 . map ( |sighash_type| sighash_type. schnorr_hash_ty ( ) )
414- . unwrap_or ( Some ( SchnorrSigHashType :: Default ) )
414+ . unwrap_or ( Some ( SchnorrSighashType :: Default ) )
415415 }
416416
417417 /// Create a psbt input from prevout
0 commit comments