Cesar Rodas 519edc4f62 Close double-spend races and atomicity gaps in the storage layer 3 semanas atrás
..
src 519edc4f62 Close double-spend races and atomicity gaps in the storage layer 3 semanas atrás
tests 40fd99e598 Kuatia: append-only, auditable, multi-asset UTXO-style ledger 1 mês atrás
Cargo.toml e0b8bbffd2 Add accounting-mapping doc and ignore .DS_Store 3 semanas atrás
README.md 2ff5b1c65f Make the Store the atomic invariant boundary for commits 3 semanas atrás

README.md

kuatia-storage

Storage abstraction for the kuatia ledger.

Defines the Store trait (composed of seven sub-traits), provides an in-memory implementation for tests, and exports a store_tests! conformance macro that any backend can use to validate its implementation.

Sub-traits

Trait Purpose
AccountStore Account CRUD and versioning
PostingStore Posting reads, reserve/release/finalize lifecycle (reserve/release carry a ReservationId)
TransferStore Transfer persistence and queries
SagaStore Saga state for crash recovery
EventStore Append-only ledger event log
BookStore Book (transfer policy scope) persistence
CommitStore commit_transfer — the single atomic commit boundary (postings + transfer + index + events)

Store is a blanket trait — any type implementing all seven sub-traits is a Store.

Conformance testing

use kuatia_storage::mem_store::InMemoryStore;

async fn new_store() -> InMemoryStore { InMemoryStore::new() }
kuatia_storage::store_tests!(new_store);

This generates a test for every Store method, run against any backend.