pub struct GovernanceGate { /* private fields */ }Expand description
Gate backend wrapping the GovernanceEngine.
Bridges the 5D effect-algebra governance engine into the kernel’s
gate slot, mapping GovernanceDecision → GateDecision. Governance
events are logged to the exochain when a ChainManager is provided.
Implementations§
Source§impl GovernanceGate
impl GovernanceGate
Sourcepub fn new(risk_threshold: f64, human_approval: bool) -> Self
pub fn new(risk_threshold: f64, human_approval: bool) -> Self
Create a governance gate with the given risk threshold.
Sourcepub fn with_chain(self, cm: Arc<ChainManager>) -> Self
pub fn with_chain(self, cm: Arc<ChainManager>) -> Self
Attach a chain manager for audit logging.
Sourcepub fn add_rule(self, rule: GovernanceRule) -> Self
pub fn add_rule(self, rule: GovernanceRule) -> Self
Add a governance rule.
Sourcepub fn engine(&self) -> &GovernanceEngine
pub fn engine(&self) -> &GovernanceEngine
Access the inner governance engine.
Sourcepub fn verify_governance_genesis(&self) -> Option<u64>
pub fn verify_governance_genesis(&self) -> Option<u64>
Verify that the governance genesis event exists on the chain.
Returns the genesis sequence number if found, or None if no
chain is attached or no genesis event exists.
Trait Implementations§
Source§impl GateBackend for GovernanceGate
impl GateBackend for GovernanceGate
Auto Trait Implementations§
impl Freeze for GovernanceGate
impl RefUnwindSafe for GovernanceGate
impl Send for GovernanceGate
impl Sync for GovernanceGate
impl Unpin for GovernanceGate
impl UnsafeUnpin for GovernanceGate
impl UnwindSafe for GovernanceGate
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more