use thiserror::Error;
pub type GovernanceResult<T> = Result<T, GovernanceError>;
#[derive(Error, Debug)]
pub enum GovernanceError {
#[error("Invalid key: {0}")]
InvalidKey(String),
#[error("Signature verification failed: {0}")]
SignatureVerification(String),
#[error("Invalid multisig configuration: {0}")]
InvalidMultisig(String),
#[error("Message format error: {0}")]
MessageFormat(String),
#[error("Cryptographic operation failed: {0}")]
Cryptographic(String),
#[error("Serialization error: {0}")]
Serialization(String),
#[error("Invalid threshold: {threshold} of {total}")]
InvalidThreshold { threshold: usize, total: usize },
#[error("Insufficient signatures: got {got}, need {need}")]
InsufficientSignatures { got: usize, need: usize },
#[error("Invalid signature format: {0}")]
InvalidSignatureFormat(String),
#[error("Invalid input: {0}")]
InvalidInput(String),
#[error("Not implemented: {0}")]
NotImplemented(String),
}