rustywallet_coinjoin/
error.rs1use thiserror::Error;
4
5pub type Result<T> = std::result::Result<T, CoinJoinError>;
7
8#[derive(Debug, Error)]
10pub enum CoinJoinError {
11 #[error("Invalid PSBT: {0}")]
13 InvalidPsbt(String),
14
15 #[error("Invalid transaction: {0}")]
17 InvalidTransaction(String),
18
19 #[error("Insufficient funds: need {needed}, have {available}")]
21 InsufficientFunds { needed: u64, available: u64 },
22
23 #[error("Invalid amount: {0}")]
25 InvalidAmount(String),
26
27 #[error("No participants in CoinJoin")]
29 NoParticipants,
30
31 #[error("Invalid participant: {0}")]
33 InvalidParticipant(String),
34
35 #[error("Fee calculation error: {0}")]
37 FeeError(String),
38
39 #[error("PayJoin error: {0}")]
41 PayJoinError(String),
42
43 #[error("Invalid output: {0}")]
45 InvalidOutput(String),
46
47 #[error("Outputs must be equal: expected {expected}, got {actual}")]
49 UnequalOutputs { expected: u64, actual: u64 },
50
51 #[error("Serialization error: {0}")]
53 SerializationError(String),
54
55 #[error("Crypto error: {0}")]
57 CryptoError(String),
58
59 #[error("Invalid address: {0}")]
61 InvalidAddress(String),
62
63 #[error("Verification failed: {0}")]
65 VerificationFailed(String),
66}