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§
fn reserve( &self, intent: &CanonicalResourceIntent, ) -> Result<LedgerAttestationCandidate, AuthorityError>
Sourcefn post(
&self,
intent: &CanonicalResourceIntent,
reservation: &LedgerAttestationCandidate,
actual_amount: u128,
) -> Result<LedgerAttestationCandidate, AuthorityError>
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.
fn void( &self, intent: &CanonicalResourceIntent, reservation: &LedgerAttestationCandidate, ) -> Result<LedgerAttestationCandidate, AuthorityError>
Sourcefn compensate(
&self,
intent: &CanonicalResourceIntent,
posted: &LedgerAttestationCandidate,
) -> Result<LedgerAttestationCandidate, AuthorityError>
fn compensate( &self, intent: &CanonicalResourceIntent, posted: &LedgerAttestationCandidate, ) -> Result<LedgerAttestationCandidate, AuthorityError>
MUST require a Posted input and create a new immutable correction.