@@ -86,7 +86,7 @@ pub enum InputError {
8686 /// Get the secp Errors directly
8787 SecpErr ( bitcoin:: secp256k1:: Error ) ,
8888 /// Key errors
89- KeyErr ( bitcoin:: key:: Error ) ,
89+ KeyErr ( bitcoin:: key:: FromSliceError ) ,
9090 /// Could not satisfy taproot descriptor
9191 /// This error is returned when both script path and key paths could not be
9292 /// satisfied. We cannot return a detailed error because we try all miniscripts
@@ -229,8 +229,8 @@ impl From<bitcoin::secp256k1::Error> for InputError {
229229}
230230
231231#[ doc( hidden) ]
232- impl From < bitcoin:: key:: Error > for InputError {
233- fn from ( e : bitcoin:: key:: Error ) -> InputError { InputError :: KeyErr ( e) }
232+ impl From < bitcoin:: key:: FromSliceError > for InputError {
233+ fn from ( e : bitcoin:: key:: FromSliceError ) -> InputError { InputError :: KeyErr ( e) }
234234}
235235
236236/// Psbt satisfier for at inputs at a particular index
@@ -399,7 +399,7 @@ fn sanity_check(psbt: &Psbt) -> Result<(), Error> {
399399 None => sighash:: EcdsaSighashType :: All ,
400400 } ;
401401 for ( key, ecdsa_sig) in & input. partial_sigs {
402- let flag = sighash:: EcdsaSighashType :: from_standard ( ecdsa_sig. hash_ty as u32 ) . map_err (
402+ let flag = sighash:: EcdsaSighashType :: from_standard ( ecdsa_sig. sighash_type as u32 ) . map_err (
403403 |_| {
404404 Error :: InputError (
405405 InputError :: Interpreter ( interpreter:: Error :: NonStandardSighash (
@@ -740,7 +740,7 @@ impl PsbtExt for Psbt {
740740 let desc_type = desc. desc_type ( ) ;
741741
742742 if let Some ( non_witness_utxo) = & input. non_witness_utxo {
743- if txin. previous_output . txid != non_witness_utxo. txid ( ) {
743+ if txin. previous_output . txid != non_witness_utxo. compute_txid ( ) {
744744 return Err ( UtxoUpdateError :: UtxoCheck ) ;
745745 }
746746 }
@@ -1313,10 +1313,12 @@ pub enum SighashError {
13131313 MissingSpendUtxos ,
13141314 /// Invalid Sighash type
13151315 InvalidSighashType ,
1316- /// Sighash computation error
1317- /// Only happens when single does not have corresponding output as psbts
1318- /// already have information to compute the sighash
1319- SighashComputationError ( sighash:: Error ) ,
1316+ /// Computation error for taproot sighash.
1317+ SighashTaproot ( sighash:: TaprootError ) ,
1318+ /// Computation error for P2WPKH sighash.
1319+ SighashP2wpkh ( sighash:: P2wpkhError ) ,
1320+ /// Computation error for P2WSH sighash.
1321+ TransactionInputsIndex ( transaction:: InputsIndexError ) ,
13201322 /// Missing Witness script
13211323 MissingWitnessScript ,
13221324 /// Missing Redeem script,
@@ -1332,11 +1334,11 @@ impl fmt::Display for SighashError {
13321334 SighashError :: MissingInputUtxo => write ! ( f, "Missing input utxo in pbst" ) ,
13331335 SighashError :: MissingSpendUtxos => write ! ( f, "Missing Psbt spend utxos" ) ,
13341336 SighashError :: InvalidSighashType => write ! ( f, "Invalid Sighash type" ) ,
1335- SighashError :: SighashComputationError ( e) => {
1336- write ! ( f, "Sighash computation error : {}" , e)
1337- }
13381337 SighashError :: MissingWitnessScript => write ! ( f, "Missing Witness Script" ) ,
13391338 SighashError :: MissingRedeemScript => write ! ( f, "Missing Redeem Script" ) ,
1339+ SighashError :: SighashTaproot ( ref e) => write ! ( f, "sighash taproot: {}" , e) ,
1340+ SighashError :: SighashP2wpkh ( ref e) => write ! ( f, "sighash p2wpkh: {}" , e) ,
1341+ SighashError :: TransactionInputsIndex ( ref e) => write ! ( f, "tx inputs index: {}" , e) ,
13401342 }
13411343 }
13421344}
@@ -1353,13 +1355,24 @@ impl error::Error for SighashError {
13531355 | InvalidSighashType
13541356 | MissingWitnessScript
13551357 | MissingRedeemScript => None ,
1356- SighashComputationError ( e) => Some ( e) ,
1358+ SighashTaproot ( ref e) => Some ( e) ,
1359+ SighashP2wpkh ( ref e) => Some ( e) ,
1360+ TransactionInputsIndex ( ref e) => Some ( e) ,
1361+
13571362 }
13581363 }
13591364}
13601365
1361- impl From < sighash:: Error > for SighashError {
1362- fn from ( e : sighash:: Error ) -> Self { SighashError :: SighashComputationError ( e) }
1366+ impl From < sighash:: TaprootError > for SighashError {
1367+ fn from ( e : sighash:: TaprootError ) -> Self { SighashError :: SighashTaproot ( e) }
1368+ }
1369+
1370+ impl From < sighash:: P2wpkhError > for SighashError {
1371+ fn from ( e : sighash:: P2wpkhError ) -> Self { SighashError :: SighashP2wpkh ( e) }
1372+ }
1373+
1374+ impl From < transaction:: InputsIndexError > for SighashError {
1375+ fn from ( e : transaction:: InputsIndexError ) -> Self { SighashError :: TransactionInputsIndex ( e) }
13631376}
13641377
13651378/// Sighash message(signing data) for a given psbt transaction input.
0 commit comments