C db22dc4cd6 Store amounts in a form the database can add up exactly hai 2 meses
..
src db22dc4cd6 Store amounts in a form the database can add up exactly hai 2 meses
tests 8bf5f4c00e Commit each transfer in one store transaction instead of a saga hai 3 meses
Cargo.toml 7e7cfde94d Introduce Kuatia, an append-only, auditable multi-asset ledger hai 4 meses
README.md 8bf5f4c00e Commit each transfer in one store transaction instead of a saga hai 3 meses

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 + generic lifecycle primitives (reserve/release/deactivate/insert)
TransferStore Transfer persistence (store_transfer) and queries
CommitStore The atomic commit boundary: commit_envelope / commit_transition (ADR-0023)
EventStore Append-only ledger event log (idempotent on a per-transfer dedup key)
BookStore Book (transfer policy scope) persistence

A transfer is committed atomically through CommitStore::commit_envelope, which applies the whole envelope in one transaction and re-checks double-spend, freeze/close, and the overdraft floor inside it. The remaining posting/account write methods are dumb instructions: each applies one update and returns the number of affected rows (or an I/O error), never interpreting the count.

Store is a blanket trait — any type implementing the 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.