Skip to main content

Crate karma_cigarette_stopping

Crate karma_cigarette_stopping 

Source
Expand description

Freeze-on-STOP karma settlement.

This crate composes karma-cigarette and stop-cigarette into a one-way workflow:

collecting entries -> STOP freezes boundary -> final settlement
use karma_cigarette_stopping::StoppingLedger;

let mut session = StoppingLedger::new();
session.record("aya", "ben", 8, "helped")?;
session.record("ben", "aya", 3, "returned help")?;
session.request_stop("operator", "period closed")?;

let final_settlement = session.finalize()?;
assert_eq!(final_settlement.plan().total_units(), 5);
assert_eq!(final_settlement.stop_record().actor(), "operator");

Structs§

Cocoshiga
Implements the Cocoshiga net-settlement principle.
CocoshigaStop
A cloneable cooperative STOP signal.
FinalSettlement
Final, auditable output of the stopping workflow.
KarmaEntry
One contribution recorded in a KarmaLedger.
KarmaLedger
An append-only collection of karma entries.
PartyId
A stable, non-empty identifier for a party in a ledger.
SettlementPlan
A deterministic settlement plan produced from a ledger.
SettlementTransfer
A payment required to satisfy a net karma position.
StopOutcome
Result of a valid STOP request.
StopRecord
Immutable provenance for the first accepted STOP request.
Stopped
Error returned when a checkpoint observes STOP.
StoppingLedger
A karma ledger with an irreversible STOP boundary.

Enums§

KarmaError
Validation and arithmetic failures returned by the crate.
RequestError
Validation failure for a STOP request.
StopStatus
Whether a request established STOP or found it already established.
StoppingError
Failure returned by the stopping workflow.