feat: accept atomic payment storage backends #17

Merged
thesimplekid merged 1 commit from fix/1-payment-storage into main 2026-10-09 14:21:35 +00:00
Owner

Applications can now supply Arc<dyn PaymentStore> through EngineOptions::with_store. All coordination journals, including Cashu receipt evidence and L402 keys, use that backend. Engine::open retains the existing redb layout, and CDK wallet storage remains separately configurable.

The public operations preserve atomic receipt ownership, capture decisions, immutable settlement state and uncertain payouts. A reusable storage-contract-tests suite exercises concurrent decisions, lost acknowledgments and reopen recovery. Embedded writes retain their ordering guard after caller cancellation. Documentation explains how application reservations can share a capture-decision transaction without treating network effects as transactional or enabling concurrent Engine ownership.

Validation: 57 unit, public API and documentation tests; formatting and Clippy; standalone contract-feature compilation; nix flake check path:. -L. Public API tests place coordination storage outside the Engine directory, recover Cashu and Lightning state, and verify no fallback redb files are created.

Closes #1.

Stacked on #16; this PR contains the storage-interface commit only.

Applications can now supply `Arc<dyn PaymentStore>` through `EngineOptions::with_store`. All coordination journals, including Cashu receipt evidence and L402 keys, use that backend. `Engine::open` retains the existing redb layout, and CDK wallet storage remains separately configurable. The public operations preserve atomic receipt ownership, capture decisions, immutable settlement state and uncertain payouts. A reusable `storage-contract-tests` suite exercises concurrent decisions, lost acknowledgments and reopen recovery. Embedded writes retain their ordering guard after caller cancellation. Documentation explains how application reservations can share a capture-decision transaction without treating network effects as transactional or enabling concurrent Engine ownership. Validation: 57 unit, public API and documentation tests; formatting and Clippy; standalone contract-feature compilation; `nix flake check path:. -L`. Public API tests place coordination storage outside the Engine directory, recover Cashu and Lightning state, and verify no fallback redb files are created. Closes #1. Stacked on #16; this PR contains the storage-interface commit only.
feat: accept atomic payment storage backends
Some checks failed
Checks / format (pull_request) Failing after 2s
Checks / checks (pull_request) Failing after 2s
Checks / cdk-compatible (pull_request) Failing after 2s
Checks / format (push) Has been cancelled
Checks / checks (push) Has been cancelled
Checks / cdk-compatible (push) Has been cancelled
b0526226b1
Expose payment, Cashu evidence and Lightning credential journals through
object-safe domain interfaces. Allow callers to supply coordination storage
while keeping the existing embedded layout and wallet configuration.

Provide reusable concurrency and restart contract checks. Document durable
application reservation decisions, cancellation, and exclusive ownership.

Refs: #1
thesimplekid changed target branch from fix/3-source-wallet-provider to main 2026-10-09 14:21:34 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thesimplekid/satsettle!17
No description provided.