Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mint: table locks #566

Merged
merged 62 commits into from
Jul 8, 2024
Merged

Mint: table locks #566

merged 62 commits into from
Jul 8, 2024

Conversation

callebtc
Copy link
Collaborator

@callebtc callebtc commented Jun 30, 2024

Move all lock states from memory into the database which will enable nutshell to run on multiple instances.

  • Migrate from sqlalchemy 1.3 to 1.4
  • Remove psycopg2, use asyncpg
  • Use connection pools and sessions
  • Database locks for individual rows (postgres)
  • MintQuote and MeltQuote objects have a pending state in the db now
  • Tests properly dispose of their db connections
  • Remove pending state in MintQuotes (NUT-04: add new state enum, deprecate paid nuts#141)
  • Various fixed

Copy link

codecov bot commented Jun 30, 2024

Codecov Report

Attention: Patch coverage is 88.42365% with 47 lines in your changes missing coverage. Please review.

Project coverage is 64.97%. Comparing base (af636db) to head (f2ba89c).

Files Patch % Lines
cashu/mint/db/write.py 87.20% 11 Missing ⚠️
cashu/mint/crud.py 66.66% 10 Missing ⚠️
cashu/mint/ledger.py 77.77% 8 Missing ⚠️
cashu/core/db.py 94.26% 7 Missing ⚠️
cashu/lightning/fake.py 40.00% 6 Missing ⚠️
cashu/core/base.py 71.42% 2 Missing ⚠️
cashu/mint/encrypt.py 0.00% 1 Missing ⚠️
cashu/mint/migrations.py 93.75% 1 Missing ⚠️
cashu/wallet/wallet.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #566      +/-   ##
==========================================
+ Coverage   60.41%   64.97%   +4.56%     
==========================================
  Files          92       92              
  Lines        8318     8449     +131     
==========================================
+ Hits         5025     5490     +465     
+ Misses       3293     2959     -334     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@callebtc callebtc added enhancement New feature or request mint About the Nutshell mint labels Jul 1, 2024
@callebtc callebtc merged commit 6a0a370 into main Jul 8, 2024
16 checks passed
@callebtc callebtc deleted the db-lock-quotes branch July 8, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mint About the Nutshell mint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant