-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy patherror.rs
More file actions
128 lines (94 loc) · 3.97 KB
/
error.rs
File metadata and controls
128 lines (94 loc) · 3.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
use bdk_wallet::bitcoin::hex::HexToBytesError;
use bdk_wallet::bitcoin::psbt::ExtractTxError;
use bdk_wallet::bitcoin::{base64, consensus};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum BDKCliError {
#[error("BIP39 error: {0:?}")]
BIP39Error(#[from] Option<bdk_wallet::bip39::Error>),
#[error("BIP32 error: {0}")]
BIP32Error(#[from] bdk_wallet::bitcoin::bip32::Error),
#[error("FeeBump error: {0}")]
BuildFeeBumpError(#[from] bdk_wallet::error::BuildFeeBumpError),
#[allow(dead_code)]
#[error("Checksum error")]
ChecksumMismatch,
#[error("Create transaction error: {0}")]
CreateTx(#[from] bdk_wallet::error::CreateTxError),
#[error("Descriptor error: {0}")]
DescriptorError(#[from] bdk_wallet::descriptor::error::Error),
#[error("Descriptor key parse error: {0}")]
DescriptorKeyParseError(#[from] bdk_wallet::miniscript::descriptor::DescriptorKeyParseError),
#[error("Base64 decoding error: {0}")]
DecodeError(#[from] base64::DecodeError),
#[error("Generic error: {0}")]
Generic(String),
#[error("Hex conversion error: {0}")]
HexToArrayError(#[from] bdk_wallet::bitcoin::hashes::hex::HexToArrayError),
#[error("Key error: {0}")]
KeyError(#[from] bdk_wallet::keys::KeyError),
#[error("LocalChain error: {0}")]
LocalChainError(#[from] bdk_wallet::chain::local_chain::ApplyHeaderError),
#[error("Miniscript error: {0}")]
MiniscriptError(#[from] bdk_wallet::miniscript::Error),
#[error("Miniscript compiler error: {0}")]
MiniscriptCompilerError(#[from] bdk_wallet::miniscript::policy::compiler::CompilerError),
#[error("ParseError: {0}")]
ParseError(#[from] bdk_wallet::bitcoin::address::ParseError),
#[error("ParseOutPointError: {0}")]
ParseOutPointError(#[from] bdk_wallet::bitcoin::blockdata::transaction::ParseOutPointError),
#[error("PsbtExtractTxError: {0}")]
PsbtExtractTxError(Box<ExtractTxError>),
#[error("PsbtError: {0}")]
PsbtError(#[from] bdk_wallet::bitcoin::psbt::Error),
#[cfg(feature = "sqlite")]
#[error("Rusqlite error: {0}")]
RusqliteError(#[from] bdk_wallet::rusqlite::Error),
#[cfg(feature = "redb")]
#[error("Redb StoreError: {0}")]
RedbStoreError(#[from] bdk_redb::error::StoreError),
#[cfg(feature = "redb")]
#[error("Redb dabtabase error: {0}")]
RedbDatabaseError(#[from] bdk_redb::redb::DatabaseError),
#[error("Serde json error: {0}")]
SerdeJson(#[from] serde_json::Error),
#[error("Bitcoin consensus encoding error: {0}")]
Serde(#[from] consensus::encode::Error),
#[error("Signer error: {0}")]
SignerError(#[from] bdk_wallet::signer::SignerError),
#[cfg(feature = "compiler")]
#[error("Secp256k1 error: {0}")]
Secp256k1Error(#[from] bdk_wallet::bitcoin::secp256k1::Error),
#[cfg(feature = "electrum")]
#[error("Electrum error: {0}")]
Electrum(#[from] bdk_electrum::electrum_client::Error),
#[cfg(feature = "esplora")]
#[error("Esplora error: {0}")]
Esplora(#[from] bdk_esplora::esplora_client::Error),
#[error("Chain connect error: {0}")]
Chain(#[from] bdk_wallet::chain::local_chain::CannotConnectError),
#[error("Consensus decoding error: {0}")]
Hex(#[from] HexToBytesError),
#[cfg(feature = "rpc")]
#[error("RPC error: {0}")]
BitcoinCoreRpcError(#[from] bdk_bitcoind_rpc::bitcoincore_rpc::Error),
#[cfg(feature = "cbf")]
#[error("BDK-Kyoto builder error: {0}")]
KyotoBuilderError(#[from] bdk_kyoto::builder::BuilderError),
#[cfg(feature = "cbf")]
#[error("BDK-Kyoto update error: {0}")]
KyotoUpdateError(#[from] bdk_kyoto::UpdateError),
#[cfg(any(
feature = "electrum",
feature = "esplora",
feature = "rpc",
feature = "cbf",
))]
#[error("Reqwest error: {0}")]
ReqwestError(#[from] reqwest::Error),
}
impl From<ExtractTxError> for BDKCliError {
fn from(value: ExtractTxError) -> Self {
BDKCliError::PsbtExtractTxError(Box::new(value))
}
}