rustywallet_taproot/
error.rs1use thiserror::Error;
4
5#[derive(Debug, Error, Clone, PartialEq, Eq)]
7pub enum TaprootError {
8 #[error("invalid x-only public key")]
10 InvalidXOnlyKey,
11
12 #[error("invalid signature")]
14 InvalidSignature,
15
16 #[error("invalid tweak: {0}")]
18 InvalidTweak(String),
19
20 #[error("invalid leaf version: 0x{0:02x}")]
22 InvalidLeafVersion(u8),
23
24 #[error("invalid control block: {0}")]
26 InvalidControlBlock(String),
27
28 #[error("tree construction error: {0}")]
30 TreeError(String),
31
32 #[error("verification failed")]
34 VerificationFailed,
35
36 #[error("invalid script: {0}")]
38 InvalidScript(String),
39
40 #[error("invalid parity value")]
42 InvalidParity,
43
44 #[error("secp256k1 error: {0}")]
46 Secp256k1Error(String),
47
48 #[error("invalid length: expected {expected}, got {got}")]
50 InvalidLength { expected: usize, got: usize },
51
52 #[error("cannot build empty tree")]
54 EmptyTree,
55
56 #[error("invalid merkle path")]
58 InvalidMerklePath,
59}