Split mint mod.rs into separate trait modules #1490

Merged
crodas merged 4 commits from feature/split-mod-file-sql-common into main 2026-01-05 11:57:17 +00:00
crodas commented 2026-01-04 03:21:51 +00:00 (Migrated from github.com)

Description

Split the large monolithic mod.rs file into separate files, each containing a database trait and its corresponding transaction trait:

  • proofs.rs: MintProofsTransaction + MintProofsDatabase
  • keys.rs: MintKeyDatabaseTransaction + MintKeysDatabase
  • quotes.rs: MintQuotesTransaction + MintQuotesDatabase
  • signatures.rs: MintSignatureTransaction + MintSignaturesDatabase
  • keyvalue.rs: KVStoreTransaction + KVStoreDatabase + KVStore
  • saga.rs: SagaTransaction + SagaDatabase
  • completed_operations.rs: CompletedOperationsTransaction + CompletedOperationsDatabase

The mod.rs now only contains struct definitions, migrations, and the main MintDatabase/MintTransaction/DbTransactionFinalizer impls.

closes: https://github.com/cashubtc/cdk/issues/1489


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

### Description Split the large monolithic mod.rs file into separate files, each containing a database trait and its corresponding transaction trait: - proofs.rs: MintProofsTransaction + MintProofsDatabase - keys.rs: MintKeyDatabaseTransaction + MintKeysDatabase - quotes.rs: MintQuotesTransaction + MintQuotesDatabase - signatures.rs: MintSignatureTransaction + MintSignaturesDatabase - keyvalue.rs: KVStoreTransaction + KVStoreDatabase + KVStore - saga.rs: SagaTransaction + SagaDatabase - completed_operations.rs: CompletedOperationsTransaction + CompletedOperationsDatabase The mod.rs now only contains struct definitions, migrations, and the main MintDatabase/MintTransaction/DbTransactionFinalizer impls. closes: https://github.com/cashubtc/cdk/issues/1489 ----- ### Notes to the reviewers <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates <!-- Please do not edit the actual changelog but note what you changed here. --> #### CHANGED #### ADDED #### REMOVED #### FIXED ---- ### Checklist * [x] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [x] I ran `just final-check` before committing
thesimplekid (Migrated from github.com) reviewed 2026-01-04 09:38:35 +00:00
@ -0,0 +1,500 @@
//! Proofs database implementation
thesimplekid (Migrated from github.com) commented 2026-01-04 09:36:01 +00:00

I think we should remove the inline.

Inline is best for small cpu bound tasks, this is async and has io.

I think we should remove the inline. Inline is best for small cpu bound tasks, this is async and has io. ```suggestion ```
@ -0,0 +1,1133 @@
//! Quotes database implementation
thesimplekid (Migrated from github.com) commented 2026-01-04 09:36:39 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:01 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:09 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:16 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:23 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:32 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:39 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) commented 2026-01-04 09:37:47 +00:00
```suggestion ```
thesimplekid (Migrated from github.com) approved these changes 2026-01-05 11:56:52 +00:00
Sign in to join this conversation.
No reviewers
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
cashubtc/cdk!1490
No description provided.