Skip to main content

EconomicAuthority

Trait EconomicAuthority 

Source
pub trait EconomicAuthority {
    // Required methods
    fn reserve(
        &self,
        intent: &CanonicalResourceIntent,
    ) -> Result<LedgerAttestationCandidate, AuthorityError>;
    fn post(
        &self,
        intent: &CanonicalResourceIntent,
        reservation: &LedgerAttestationCandidate,
        actual_amount: u128,
    ) -> Result<LedgerAttestationCandidate, AuthorityError>;
    fn void(
        &self,
        intent: &CanonicalResourceIntent,
        reservation: &LedgerAttestationCandidate,
    ) -> Result<LedgerAttestationCandidate, AuthorityError>;
    fn compensate(
        &self,
        intent: &CanonicalResourceIntent,
        posted: &LedgerAttestationCandidate,
    ) -> Result<LedgerAttestationCandidate, AuthorityError>;
}

Required Methods§

Source

fn reserve( &self, intent: &CanonicalResourceIntent, ) -> Result<LedgerAttestationCandidate, AuthorityError>

Source

fn post( &self, intent: &CanonicalResourceIntent, reservation: &LedgerAttestationCandidate, actual_amount: u128, ) -> Result<LedgerAttestationCandidate, AuthorityError>

MUST require a Reserved input, enforce actual_amount <= reserved, and preserve the deterministic transfer lineage from operation ID.

Source

fn void( &self, intent: &CanonicalResourceIntent, reservation: &LedgerAttestationCandidate, ) -> Result<LedgerAttestationCandidate, AuthorityError>

Source

fn compensate( &self, intent: &CanonicalResourceIntent, posted: &LedgerAttestationCandidate, ) -> Result<LedgerAttestationCandidate, AuthorityError>

MUST require a Posted input and create a new immutable correction.

Implementors§