Sigil documentation
ReferenceRust referencesigil-governance

sigil-governance · execution

Source declarations, signatures and documentation for execution.

Source: sigil/node/sigil-governance/src/execution.rs. SHA-256: a4d3385a3a3eecb89d597655f6c432c4651e3c8afa71489d09ca445c333422a1.

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.

execution::TimelockStatus

Lifecycle of a timelock entry.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum TimelockStatus {
    /// Waiting for the execution epoch.
    Pending,
    /// Current epoch has reached or passed the execution epoch.
    Ready,
    /// Successfully executed.
    Executed,
    /// Cancelled before execution.
    Cancelled,
}

Source line: 14.

execution::TimelockEntry

A single entry in the timelock queue representing a passed proposal awaiting execution.

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct TimelockEntry {
/// ID of the passed proposal.

pub proposal_id: String,
/// Proposal type (determines timelock duration).

pub proposal_type: ProposalType,
/// The action to execute.

pub payload: ProposalPayload,
/// Epoch at which this entry becomes executable.

pub execution_epoch: u64,
/// Current status of this entry.

pub status: TimelockStatus
}

Source line: 32.

execution::TimelockQueue

Ordered collection of timelock entries waiting for execution.

#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct TimelockQueue {

}

Source line: 51.

execution::TimelockQueue::new

Create an empty timelock queue.

#[must_use]
pub fn new() -> Self;

Source line: 58.

execution::TimelockQueue::add

Add an entry to the queue.

pub fn add(&mut self, entry: TimelockEntry);

Source line: 65.

execution::TimelockQueue::ready_entries

Return all entries whose execution epoch has been reached and whose status is still [TimelockStatus::Pending].

This method also promotes matching entries to [TimelockStatus::Ready].

pub fn ready_entries(&mut self, current_epoch: u64) -> Vec<&TimelockEntry>;

Source line: 73.

execution::TimelockQueue::cancel

Cancel a pending or ready entry. Returns an error if the entry is not found or has already been executed/cancelled.

pub fn cancel(&mut self, proposal_id: &str) -> Result<(), GovernanceError>;

Source line: 90.

execution::TimelockQueue::mark_executed

Mark an entry as executed. Returns an error if the entry is not found or is not in the [TimelockStatus::Ready] state.

pub fn mark_executed(&mut self, proposal_id: &str) -> Result<(), GovernanceError>;

Source line: 111.

execution::TimelockQueue::pending_count

Number of entries still in [TimelockStatus::Pending] state.

#[must_use]
pub fn pending_count(&self) -> usize;

Source line: 133.

execution::TimelockQueue::len

Total number of entries in the queue (all statuses).

#[must_use]
pub fn len(&self) -> usize;

Source line: 142.

execution::TimelockQueue::is_empty

Returns true if the queue has no entries.

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

Source line: 148.

On this page