@@ -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
@@ -1702,7 +1702,7 @@ impl<D> Wallet<D> {
17021702 /// # use bitcoin::*;
17031703 /// # use bdk::*;
17041704 /// # use bdk::wallet::ChangeSet;
1705- /// # use bdk::wallet::error::{ CreateTxError, SignError} ;
1705+ /// # use bdk::wallet::error::CreateTxError;
17061706 /// # use bdk_chain::PersistBackend;
17071707 /// # let descriptor = "wpkh(tpubD6NzVbkrYhZ4Xferm7Pz4VnjdcDPFyjVu5K4iZXQ4pVN8Cks4pHVowTBXBKRhX64pkRyJZJN5xAKj4UDNnLPb5p2sSKXhewoYx5GbTdUFWq/*)";
17081708 /// # let mut wallet = doctest_wallet!();
@@ -1712,18 +1712,18 @@ impl<D> Wallet<D> {
17121712 /// builder.add_recipient(to_address.script_pubkey(), 50_000);
17131713 /// builder.finish()?
17141714 /// };
1715- /// let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
1715+ /// let finalized = wallet.sign(&mut psbt, SignOptions::default())?;
17161716 /// assert!(finalized, "we should have signed all the inputs");
17171717 /// # Ok::<(),anyhow::Error>(())
17181718 pub fn sign (
17191719 & self ,
17201720 psbt : & mut psbt:: PartiallySignedTransaction ,
17211721 sign_options : SignOptions ,
1722- ) -> Result < bool , SignError > {
1722+ ) -> Result < bool , SignerError > {
17231723 // This adds all the PSBT metadata for the inputs, which will help us later figure out how
17241724 // to derive our keys
17251725 self . update_psbt_with_descriptor ( psbt)
1726- . map_err ( SignError :: MiniscriptPsbt ) ?;
1726+ . map_err ( SignerError :: MiniscriptPsbt ) ?;
17271727
17281728 // If we aren't allowed to use `witness_utxo`, ensure that every input (except p2tr and finalized ones)
17291729 // has the `non_witness_utxo`
@@ -1735,7 +1735,7 @@ impl<D> Wallet<D> {
17351735 . filter ( |i| i. tap_internal_key . is_none ( ) && i. tap_merkle_root . is_none ( ) )
17361736 . any ( |i| i. non_witness_utxo . is_none ( ) )
17371737 {
1738- return Err ( SignError :: Signer ( SignerError :: MissingNonWitnessUtxo ) ) ;
1738+ return Err ( SignerError :: MissingNonWitnessUtxo ) ;
17391739 }
17401740
17411741 // If the user hasn't explicitly opted-in, refuse to sign the transaction unless every input
@@ -1748,7 +1748,7 @@ impl<D> Wallet<D> {
17481748 || i. sighash_type == Some ( TapSighashType :: Default . into ( ) )
17491749 } )
17501750 {
1751- return Err ( SignError :: Signer ( SignerError :: NonStandardSighash ) ) ;
1751+ return Err ( SignerError :: NonStandardSighash ) ;
17521752 }
17531753
17541754 for signer in self
@@ -1757,9 +1757,7 @@ impl<D> Wallet<D> {
17571757 . iter ( )
17581758 . chain ( self . change_signers . signers ( ) . iter ( ) )
17591759 {
1760- signer
1761- . sign_transaction ( psbt, & sign_options, & self . secp )
1762- . map_err ( SignError :: Signer ) ?;
1760+ signer. sign_transaction ( psbt, & sign_options, & self . secp ) ?;
17631761 }
17641762
17651763 // attempt to finalize
@@ -1813,7 +1811,7 @@ impl<D> Wallet<D> {
18131811 let psbt_input = & psbt
18141812 . inputs
18151813 . get ( n)
1816- . ok_or ( SignerError :: Signer ( SignerError :: InputIndexOutOfRange ) ) ?;
1814+ . ok_or ( SignerError :: InputIndexOutOfRange ) ?;
18171815 if psbt_input. final_script_sig . is_some ( ) || psbt_input. final_script_witness . is_some ( ) {
18181816 continue ;
18191817 }
0 commit comments