blvm_sdk/governance/
error.rs1use thiserror::Error;
6
7pub type GovernanceResult<T> = Result<T, GovernanceError>;
9
10#[derive(Error, Debug)]
12pub enum GovernanceError {
13 #[error("Invalid key: {0}")]
15 InvalidKey(String),
16
17 #[error("Signature verification failed: {0}")]
19 SignatureVerification(String),
20
21 #[error("Invalid multisig configuration: {0}")]
23 InvalidMultisig(String),
24
25 #[error("Message format error: {0}")]
27 MessageFormat(String),
28
29 #[error("Cryptographic operation failed: {0}")]
31 Cryptographic(String),
32
33 #[error("Serialization error: {0}")]
35 Serialization(String),
36
37 #[error("Invalid threshold: {threshold} of {total}")]
39 InvalidThreshold { threshold: usize, total: usize },
40
41 #[error("Insufficient signatures: got {got}, need {need}")]
43 InsufficientSignatures { got: usize, need: usize },
44
45 #[error("Invalid signature format: {0}")]
47 InvalidSignatureFormat(String),
48
49 #[error("Invalid input: {0}")]
51 InvalidInput(String),
52
53 #[error("Not implemented: {0}")]
55 NotImplemented(String),
56}