pub struct GovernanceAction {Show 13 fields
pub action_id: ActionId,
pub org_subject: SubjectId,
pub action_type: GovernanceActionType,
pub policy_id: PolicyId,
pub action_commitment: [u8; 32],
pub effective_at: Timestamp,
pub expires_at: Timestamp,
pub attachments: Option<GovernanceAttachment>,
pub approvers: Vec<Address>,
pub required_threshold: u8,
pub status: GovernanceActionStatus,
pub created_at: Timestamp,
pub recorded_at_height: BlockHeight,
}Expand description
Governance action record (SRC-832)
Fields§
§action_id: ActionIdUnique action ID
org_subject: SubjectIdOrganization subject (SRC-801)
action_type: GovernanceActionTypeAction type
policy_id: PolicyIdPolicy ID that authorized this action (SRC-803)
action_commitment: [u8; 32]Action commitment (BLAKE3 hash of resolution/minutes/terms)
effective_at: TimestampEffective timestamp
expires_at: TimestampExpiry timestamp (0 = no expiry)
attachments: Option<GovernanceAttachment>Optional attachments reference
approvers: Vec<Address>Approvers (addresses that signed/approved)
required_threshold: u8Required threshold
status: GovernanceActionStatusAction status
created_at: TimestampCreated timestamp
recorded_at_height: BlockHeightBlock height when recorded
Implementations§
Source§impl GovernanceAction
impl GovernanceAction
Sourcepub fn generate_action_id(
org_subject: &SubjectId,
action_type: GovernanceActionType,
action_commitment: &[u8; 32],
nonce: &[u8; 32],
) -> ActionId
pub fn generate_action_id( org_subject: &SubjectId, action_type: GovernanceActionType, action_commitment: &[u8; 32], nonce: &[u8; 32], ) -> ActionId
Generate action ID
Sourcepub fn is_threshold_met(&self) -> bool
pub fn is_threshold_met(&self) -> bool
Check if threshold is met
Sourcepub fn is_expired(&self, current_time: Timestamp) -> bool
pub fn is_expired(&self, current_time: Timestamp) -> bool
Check if action is expired
Trait Implementations§
Source§impl Clone for GovernanceAction
impl Clone for GovernanceAction
Source§fn clone(&self) -> GovernanceAction
fn clone(&self) -> GovernanceAction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GovernanceAction
impl Debug for GovernanceAction
Source§impl<'de> Deserialize<'de> for GovernanceAction
impl<'de> Deserialize<'de> for GovernanceAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GovernanceAction
impl PartialEq for GovernanceAction
Source§fn eq(&self, other: &GovernanceAction) -> bool
fn eq(&self, other: &GovernanceAction) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for GovernanceAction
impl Serialize for GovernanceAction
impl Eq for GovernanceAction
impl StructuralPartialEq for GovernanceAction
Auto Trait Implementations§
impl Freeze for GovernanceAction
impl RefUnwindSafe for GovernanceAction
impl Send for GovernanceAction
impl Sync for GovernanceAction
impl Unpin for GovernanceAction
impl UnsafeUnpin for GovernanceAction
impl UnwindSafe for GovernanceAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more