Sigil documentation
ReferenceRust referencesigil-governance

sigil-governance · proposal

Source declarations, signatures and documentation for proposal.

Source: sigil/node/sigil-governance/src/proposal.rs. SHA-256: b16ff906488a6ec4dad5dcfe077f98fef85bd10faafd22d116ae3c7f0bda96dd.

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.

proposal::ProposalType

The five governance proposal types, each with different approval thresholds, voting periods, and timelock durations.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ProposalType {
    /// Change a chain parameter (60% threshold).
    ParameterChange,
    /// Upgrade a WASI module binary (75% threshold).
    WasiModuleUpgrade,
    /// Spend funds from the community treasury (67% threshold).
    TreasurySpend,
    /// Slash a validator for misbehaviour (67% threshold).
    ValidatorSlashing,
    /// Emergency governance action requiring super-majority (80% threshold).
    EmergencyAction,
}

Source line: 12.

proposal::ProposalType::approval_threshold

Fraction of (yes / (yes + no + veto)) required for approval.

#[must_use]
pub fn approval_threshold(&self) -> f64;

Source line: 28.

proposal::ProposalType::veto_threshold

Fraction of (veto / (yes + no + veto)) above which the proposal is vetoed.

#[must_use]
pub fn veto_threshold(&self) -> f64;

Source line: 40.

proposal::ProposalType::voting_period_epochs

Number of epochs the voting window is open.

#[must_use]
pub fn voting_period_epochs(&self) -> u64;

Source line: 46.

proposal::ProposalType::timelock_epochs

Number of epochs between passing and earliest execution.

#[must_use]
pub fn timelock_epochs(&self) -> u64;

Source line: 55.

proposal::ProposalType::min_deposit

Minimum deposit in micro-MINT required to submit this proposal type.

#[must_use]
pub fn min_deposit(&self) -> u64;

Source line: 64.

proposal::ProposalPayload

Type-specific data carried by a proposal.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum ProposalPayload {
    /// Change a chain parameter from one value to another.
    ParameterChange {
        parameter_path: String,
        old_value: serde_json::Value,
        new_value: serde_json::Value,
    },
    /// Upgrade a WASI module to a new binary.
    WasiModuleUpgrade {
        module_name: String,
        current_hash: String,
        new_hash: String,
        new_wasm_size: u64,
    },
    /// Transfer funds from the community treasury.
    TreasurySpend {
        recipient_did: String,
        amount: u64,
        reason: String,
    },
    /// Slash a validator for a documented offense.
    ValidatorSlashing {
        validator_did: String,
        offense_description: String,
        evidence_hashes: Vec<String>,
    },
    /// Emergency action with freeform parameters.
    EmergencyAction {
        action_type: String,
        parameters: serde_json::Value,
    },
}

Source line: 81.

proposal::ProposalStatus

Lifecycle states of a governance proposal.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum ProposalStatus {
    /// Collecting the required deposit.
    Deposit,
    /// Active voting period.
    Voting,
    /// Passed vote but not yet executed (in timelock).
    Passed,
    /// Did not reach the approval threshold.
    Rejected,
    /// Successfully executed after timelock.
    Executed,
    /// Cancelled by the proposer before execution.
    Cancelled,
    /// Rejected via NoWithVeto exceeding the veto threshold.
    Vetoed,
    /// Execution was attempted but failed.
    Failed,
}

Source line: 120.

proposal::ProposalStatus::is_terminal

Returns true if the proposal has reached a final state and cannot transition further.

#[must_use]
pub fn is_terminal(&self) -> bool;

Source line: 143.

proposal::Proposal

A governance proposal submitted to the chain.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Proposal {
/// Unique proposal identifier.

pub id: String,
/// DID of the account that submitted the proposal.

pub proposer_did: String,
/// Category of the proposal, determines thresholds and periods.

pub proposal_type: ProposalType,
/// Short human-readable title.

pub title: String,
/// Extended description / rationale.

pub description: String,
/// Type-specific payload data.

pub payload: ProposalPayload,
/// Current lifecycle status.

pub status: ProposalStatus,
/// Epoch at which the proposal was submitted.

pub submit_epoch: u64,
/// Epoch at which voting begins (after deposit is met).

pub voting_start_epoch: u64,
/// Epoch at which voting closes.

pub voting_end_epoch: u64,
/// Epoch at which the proposal may be executed (after timelock).

/// `None` until the proposal passes.

pub execution_epoch: Option<u64>,
/// Deposit amount in micro-MINT.

pub deposit: u64
}

Source line: 157.

proposal::Proposal::is_active

Determines whether the proposal is in an active, non-terminal state.

#[must_use]
pub fn is_active(&self) -> bool;

Source line: 188.

proposal::Proposal::is_terminal

Determines whether the proposal has reached a terminal state.

#[must_use]
pub fn is_terminal(&self) -> bool;

Source line: 197.

proposal::Proposal::can_transition_to

Returns true if transitioning from the current status to new_status is a legal state machine transition.

#[must_use]
pub fn can_transition_to(&self, new_status: ProposalStatus) -> bool;

Source line: 204.

On this page