Sigil documentation
ReferenceRust referencesigil-state

sigil-state · dao_validators::mandate_spend

Source declarations, signatures and documentation for dao_validators::mandate_spend.

Source: sigil/node/sigil-state/src/dao_validators/mandate_spend.rs. SHA-256: aa6c82116cdfc0ab2d0a0101a948c0fd06af18933e66b805c6845b5d89b2c53d.

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.

Module condition:

#[cfg(any(feature = "dao-validators", test))]

dao_validators::mandate_spend::validate_mandate_spend

Validate a mandate spend against the GAL snapshot.

Returns the [MandateClearance] that callers MUST then atomically apply (decrementing remaining budget on the on-chain Mandate record).

Trust path enforced, in order:

  1. Issuer GAL-verified — mandate.issuer_did MUST resolve to IssuerTrust::Verified in the snapshot. Any other variant promotes to its corresponding DaoValidatorError.
  2. Actor not revoked — the actor whose spend is being recorded MUST not be revoked on Sigil (snapshot's raw revocation entry).
  3. Counterparty not revoked — same check on the receiving DID.
  4. Mandate authorizes spend — delegates to [Mandate::authorize_spend] which enforces token, scope, per-tx limit, total budget, expiration, allowed counterparty, and active-status invariants. Any failure surfaces as [DaoValidatorError::InsufficientSpendAuthority].

No "trusted caller" shortcut: the only way to construct a [GalSnapshot] is through [super::snapshot::build_snapshot] (or, in tests, the crate-private test_support helpers).

#[cfg(any(feature = "dao-validators", test))]
pub fn validate_mandate_spend(
    snapshot: &GalSnapshot,
    mandate: &Mandate,
    request: &SpendRequest<'_>,
) -> Result<MandateClearance, DaoValidatorError>;

Source line: 42.

On this page