@@ -20,25 +20,6 @@ use core::fmt;
2020pub enum Error {
2121 /// Generic error
2222 Generic ( String ) ,
23- /// Cannot build a tx without recipients
24- NoRecipients ,
25- /// `manually_selected_only` option is selected but no utxo has been passed
26- NoUtxosSelected ,
27- /// Output created is under the dust limit, 546 satoshis
28- OutputBelowDustLimit ( usize ) ,
29- /// Wallet's UTXO set is not enough to cover recipient's requested plus fee
30- InsufficientFunds {
31- /// Sats needed for some transaction
32- needed : u64 ,
33- /// Sats available for spending
34- available : u64 ,
35- } ,
36- /// Branch and bound coin selection possible attempts with sufficiently big UTXO set could grow
37- /// exponentially, thus a limit is set, and when hit, this error is thrown
38- BnBTotalTriesExceeded ,
39- /// Branch and bound coin selection tries to avoid needing a change by finding the right inputs for
40- /// the desired outputs plus fee, if there is not such combination this error is thrown
41- BnBNoExactMatch ,
4223 /// Happens when trying to spend an UTXO that is not in the internal database
4324 UnknownUtxo ,
4425 /// Thrown when a tx is not found in the internal database
@@ -47,32 +28,12 @@ pub enum Error {
4728 TransactionConfirmed ,
4829 /// Trying to replace a tx that has a sequence >= `0xFFFFFFFE`
4930 IrreplaceableTransaction ,
50- /// When bumping a tx the fee rate requested is lower than required
51- FeeRateTooLow {
52- /// Required fee rate (satoshi/vbyte)
53- required : crate :: types:: FeeRate ,
54- } ,
55- /// When bumping a tx the absolute fee requested is lower than replaced tx absolute fee
56- FeeTooLow {
57- /// Required fee absolute value (satoshi)
58- required : u64 ,
59- } ,
6031 /// Node doesn't have data to estimate a fee rate
6132 FeeRateUnavailable ,
62- /// In order to use the [`TxBuilder::add_global_xpubs`] option every extended
63- /// key in the descriptor must either be a master key itself (having depth = 0) or have an
64- /// explicit origin provided
65- ///
66- /// [`TxBuilder::add_global_xpubs`]: crate::wallet::tx_builder::TxBuilder::add_global_xpubs
67- MissingKeyOrigin ( String ) ,
6833 /// Error while working with [`keys`](crate::keys)
6934 Key ( crate :: keys:: KeyError ) ,
7035 /// Descriptor checksum mismatch
7136 ChecksumMismatch ,
72- /// Spending policy is not compatible with this [`KeychainKind`](crate::types::KeychainKind)
73- SpendingPolicyRequired ( crate :: types:: KeychainKind ) ,
74- /// Error while extracting and manipulating policies
75- InvalidPolicyPathError ( crate :: descriptor:: policy:: PolicyError ) ,
7637 /// Signing error
7738 Signer ( crate :: wallet:: signer:: SignerError ) ,
7839 /// Requested outpoint doesn't exist in the tx (vout greater than available outputs)
@@ -115,40 +76,15 @@ impl fmt::Display for Error {
11576 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
11677 match self {
11778 Self :: Generic ( err) => write ! ( f, "Generic error: {}" , err) ,
118- Self :: NoRecipients => write ! ( f, "Cannot build tx without recipients" ) ,
119- Self :: NoUtxosSelected => write ! ( f, "No UTXO selected" ) ,
120- Self :: OutputBelowDustLimit ( limit) => {
121- write ! ( f, "Output below the dust limit: {}" , limit)
122- }
123- Self :: InsufficientFunds { needed, available } => write ! (
124- f,
125- "Insufficient funds: {} sat available of {} sat needed" ,
126- available, needed
127- ) ,
128- Self :: BnBTotalTriesExceeded => {
129- write ! ( f, "Branch and bound coin selection: total tries exceeded" )
130- }
131- Self :: BnBNoExactMatch => write ! ( f, "Branch and bound coin selection: not exact match" ) ,
13279 Self :: UnknownUtxo => write ! ( f, "UTXO not found in the internal database" ) ,
13380 Self :: TransactionNotFound => {
13481 write ! ( f, "Transaction not found in the internal database" )
13582 }
13683 Self :: TransactionConfirmed => write ! ( f, "Transaction already confirmed" ) ,
13784 Self :: IrreplaceableTransaction => write ! ( f, "Transaction can't be replaced" ) ,
138- Self :: FeeRateTooLow { required } => write ! (
139- f,
140- "Fee rate too low: required {} sat/vbyte" ,
141- required. as_sat_per_vb( )
142- ) ,
143- Self :: FeeTooLow { required } => write ! ( f, "Fee to low: required {} sat" , required) ,
14485 Self :: FeeRateUnavailable => write ! ( f, "Fee rate unavailable" ) ,
145- Self :: MissingKeyOrigin ( err) => write ! ( f, "Missing key origin: {}" , err) ,
14686 Self :: Key ( err) => write ! ( f, "Key error: {}" , err) ,
14787 Self :: ChecksumMismatch => write ! ( f, "Descriptor checksum mismatch" ) ,
148- Self :: SpendingPolicyRequired ( keychain_kind) => {
149- write ! ( f, "Spending policy required: {:?}" , keychain_kind)
150- }
151- Self :: InvalidPolicyPathError ( err) => write ! ( f, "Invalid policy path: {}" , err) ,
15288 Self :: Signer ( err) => write ! ( f, "Signer error: {}" , err) ,
15389 Self :: InvalidOutpoint ( outpoint) => write ! (
15490 f,
@@ -181,7 +117,6 @@ macro_rules! impl_error {
181117}
182118
183119impl_error ! ( descriptor:: error:: Error , Descriptor ) ;
184- impl_error ! ( descriptor:: policy:: PolicyError , InvalidPolicyPathError ) ;
185120impl_error ! ( wallet:: signer:: SignerError , Signer ) ;
186121
187122impl From < crate :: keys:: KeyError > for Error {
0 commit comments