@@ -74,7 +74,7 @@ use crate::psbt::PsbtUtils;
7474use crate :: signer:: SignerError ;
7575use crate :: types:: * ;
7676use crate :: wallet:: coin_selection:: Excess :: { Change , NoChange } ;
77- use crate :: wallet:: error:: { BuildFeeBumpError , CreateTxError , MiniscriptPsbtError , SignError } ;
77+ use crate :: wallet:: error:: { BuildFeeBumpError , CreateTxError , MiniscriptPsbtError } ;
7878
7979const COINBASE_MATURITY : u32 = 100 ;
8080
@@ -1430,7 +1430,7 @@ impl<D> Wallet<D> {
14301430 /// # use bitcoin::*;
14311431 /// # use bdk::*;
14321432 /// # use bdk::wallet::ChangeSet;
1433- /// # use bdk::wallet::error::{ CreateTxError, SignError} ;
1433+ /// # use bdk::wallet::error::CreateTxError;
14341434 /// # use bdk_chain::PersistBackend;
14351435 /// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";
14361436 /// # let mut wallet = doctest_wallet!();
@@ -1440,18 +1440,18 @@ impl<D> Wallet<D> {
14401440 /// builder.add_recipient(to_address.script_pubkey(), 50_000);
14411441 /// builder.finish()?
14421442 /// };
1443- /// let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
1443+ /// let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
14441444 /// assert!(finalized, "we should have signed all the inputs");
14451445 /// # Ok::<(),anyhow::Error>(())
14461446 pub fn sign (
14471447 & self ,
14481448 psbt : & mut psbt:: PartiallySignedTransaction ,
14491449 sign_options : SignOptions ,
1450- ) -> Result < bool , SignError > {
1450+ ) -> Result < bool , SignerError > {
14511451 // This adds all the PSBT metadata for the inputs, which will help us later figure out how
14521452 // to derive our keys
14531453 self . update_psbt_with_descriptor ( psbt)
1454- . map_err ( SignError :: MiniscriptPsbt ) ?;
1454+ . map_err ( SignerError :: MiniscriptPsbt ) ?;
14551455
14561456 // If we aren't allowed to use `witness_utxo`, ensure that every input (except p2tr and finalized ones)
14571457 // has the `non_witness_utxo`
@@ -1463,7 +1463,7 @@ impl<D> Wallet<D> {
14631463 . filter ( |i| i. tap_internal_key . is_none ( ) && i. tap_merkle_root . is_none ( ) )
14641464 . any ( |i| i. non_witness_utxo . is_none ( ) )
14651465 {
1466- return Err ( SignError :: Signer ( SignerError :: MissingNonWitnessUtxo ) ) ;
1466+ return Err ( SignerError :: MissingNonWitnessUtxo ) ;
14671467 }
14681468
14691469 // If the user hasn't explicitly opted-in, refuse to sign the transaction unless every input
@@ -1476,7 +1476,7 @@ impl<D> Wallet<D> {
14761476 || i. sighash_type == Some ( TapSighashType :: Default . into ( ) )
14771477 } )
14781478 {
1479- return Err ( SignError :: Signer ( SignerError :: NonStandardSighash ) ) ;
1479+ return Err ( SignerError :: NonStandardSighash ) ;
14801480 }
14811481
14821482 for signer in self
@@ -1485,9 +1485,7 @@ impl<D> Wallet<D> {
14851485 . iter ( )
14861486 . chain ( self . change_signers . signers ( ) . iter ( ) )
14871487 {
1488- signer
1489- . sign_transaction ( psbt, & sign_options, & self . secp )
1490- . map_err ( SignError :: Signer ) ?;
1488+ signer. sign_transaction ( psbt, & sign_options, & self . secp ) ?;
14911489 }
14921490
14931491 // attempt to finalize
@@ -1531,7 +1529,7 @@ impl<D> Wallet<D> {
15311529 & self ,
15321530 psbt : & mut psbt:: PartiallySignedTransaction ,
15331531 sign_options : SignOptions ,
1534- ) -> Result < bool , SignError > {
1532+ ) -> Result < bool , SignerError > {
15351533 let chain_tip = self . chain . tip ( ) . map ( |cp| cp. block_id ( ) ) . unwrap_or_default ( ) ;
15361534
15371535 let tx = & psbt. unsigned_tx ;
@@ -1541,7 +1539,7 @@ impl<D> Wallet<D> {
15411539 let psbt_input = & psbt
15421540 . inputs
15431541 . get ( n)
1544- . ok_or ( SignError :: Signer ( SignerError :: InputIndexOutOfRange ) ) ?;
1542+ . ok_or ( SignerError :: InputIndexOutOfRange ) ?;
15451543 if psbt_input. final_script_sig . is_some ( ) || psbt_input. final_script_witness . is_some ( ) {
15461544 continue ;
15471545 }
0 commit comments