Skip to main content

Module iou_store

Module iou_store 

Source
Expand description

SQLite-backed persistence for IOU envelopes.

The iou_envelope table is keyed by receipt_id so a finalized receipt maps to exactly one row. Re-processing the same finalized receipt is idempotent: a byte-identical envelope returns Ok(false); a different envelope returns IouEnvelopeStoreError::Conflict.

The migration is CREATE TABLE IF NOT EXISTS plus CREATE INDEX IF NOT EXISTS, so it can run repeatedly against a receipt-store database that already holds other tables.

Structs§

SqliteIouEnvelopeStore
SQLite-backed IouEnvelopeStore implementation. Wraps an existing connection pool from crate::SqliteReceiptStore so IOU writes share the same SQLite database and journal mode.

Constants§

IOU_ENVELOPE_MIGRATION
SQL migration applied by SqliteIouEnvelopeStore::open_with_pool to create the iou_envelope table.