1use thiserror::Error;
4
5#[derive(Error, Debug)]
7pub enum CryptoError {
8 #[error("Invalid key length")]
10 InvalidKeyLength,
11
12 #[error("Encryption failed: {0}")]
14 EncryptionFailed(String),
15
16 #[error("Decryption failed: {0}")]
18 DecryptionFailed(String),
19
20 #[error("Signature format error: {0}")]
22 SignatureFormatError(String),
23
24 #[error("Keypair already exists: {0}")]
26 KeypairAlreadyExists(String),
27
28 #[error("Keypair not found: {0}")]
30 KeypairNotFound(String),
31
32 #[error("No active key space")]
34 NoActiveSpace,
35
36 #[error("No keypair selected")]
38 NoKeypairSelected,
39
40 #[error("Serialization error: {0}")]
42 SerializationError(String),
43
44 #[error("Invalid address format: {0}")]
46 InvalidAddress(String),
47
48 #[error("Smart contract error: {0}")]
50 ContractError(String),
51}
52
53