Skip to main content

Module mem

Module mem 

Source
Expand description

MemLedger — the in-memory reference implementation.

Two jobs (plan §3.3):

  1. The WASM-capable backend: a browser cell / Wanix guest can run a real ledger for local-first quota. It uses no tokio, no I/O, and no wall clock — the logical clock is driven explicitly via MemLedger::advance_clock, so behaviour is fully deterministic and reproducible.
  2. The proptest oracle: every other backend is equivalence-tested against it, so its commit loop is the canonical interpretation of engine::stage.

It keeps everything — journal, outcomes, terminal reservations, outbox — in memory forever (outcome-retention pruning is a later work item). The commit loop mirrors the RocksLedger one (idempotency-check → stage → single atomic apply → advance head), so the two stay observably identical.

Structs§

MemLedger
An in-memory single-writer double-entry ledger.