Sigil documentation
ReferenceRust referencesigil-governance

sigil-governance · error

Source declarations, signatures and documentation for error.

Source: sigil/node/sigil-governance/src/error.rs. SHA-256: b86420f84e6522d569701fe8d92930482f253bd147dde8607e5484050b227cca.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

error::GovernanceError

Errors that can occur during governance operations.

#[derive(Debug, Clone, thiserror::Error)]
pub enum GovernanceError {
    #[error("proposal not found: {0}")]
    ProposalNotFound(String),

    #[error("invalid proposal transition from {from:?} to {to:?}")]
    InvalidProposalTransition {
        from: ProposalStatus,
        to: ProposalStatus,
    },

    #[error("insufficient deposit: required {required}, provided {provided}")]
    InsufficientDeposit { required: u64, provided: u64 },

    #[error("voting not active for proposal: {0}")]
    VotingNotActive(String),

    #[error("voter {voter_did} already voted on proposal {proposal_id}")]
    AlreadyVoted {
        voter_did: String,
        proposal_id: String,
    },

    #[error("voter not eligible: {0}")]
    NotEligibleToVote(String),

    #[error("timelock not ready for proposal {proposal_id}: current epoch {current_epoch}, execution epoch {execution_epoch}")]
    TimelockNotReady {
        proposal_id: String,
        current_epoch: u64,
        execution_epoch: u64,
    },

    #[error("proposal expired: {0}")]
    ProposalExpired(String),

    #[error("invalid payload: {0}")]
    InvalidPayload(String),

    #[error("emergency action not authorized: {0}")]
    EmergencyNotAuthorized(String),
}

Source line: 7.

On this page