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 settlementuse 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.
- Cocoshiga
Stop - A cloneable cooperative STOP signal.
- Final
Settlement - Final, auditable output of the stopping workflow.
- Karma
Entry - One contribution recorded in a
KarmaLedger. - Karma
Ledger - An append-only collection of karma entries.
- PartyId
- A stable, non-empty identifier for a party in a ledger.
- Settlement
Plan - A deterministic settlement plan produced from a ledger.
- Settlement
Transfer - A payment required to satisfy a net karma position.
- Stop
Outcome - Result of a valid STOP request.
- Stop
Record - Immutable provenance for the first accepted STOP request.
- Stopped
- Error returned when a checkpoint observes STOP.
- Stopping
Ledger - A karma ledger with an irreversible STOP boundary.
Enums§
- Karma
Error - Validation and arithmetic failures returned by the crate.
- Request
Error - Validation failure for a STOP request.
- Stop
Status - Whether a request established STOP or found it already established.
- Stopping
Error - Failure returned by the stopping workflow.