Skip to content

Remove paid field in MeltQuote#1024

Open
KvngMikey wants to merge 2 commits into
cashubtc:mainfrom
KvngMikey:deprecate-paid-in-melt
Open

Remove paid field in MeltQuote#1024
KvngMikey wants to merge 2 commits into
cashubtc:mainfrom
KvngMikey:deprecate-paid-in-melt

Conversation

@KvngMikey
Copy link
Copy Markdown
Contributor

Follow up to #838

Fully Fixes #855

Supercedes #870

Summary

This PR completes the deprecation and removal of the legacy paid fields in melt_quotes, fully migrating the system to rely on the state field as the single source of truth for quote payment status.

  • Tests depending on the legacy paid field were updated.
  • Foreign-key–related failures caused by table recreation were fixed by explicitly restoring the correct schema during the migration.

Copilot AI review requested due to automatic review settings May 28, 2026 14:29
@github-project-automation github-project-automation Bot moved this to Backlog in nutshell May 28, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Removes the deprecated paid boolean from melt quote storage/models/APIs and shifts behavior/tests to rely solely on state.

Changes:

  • Dropped paid from PostMeltQuoteResponse and related API response construction paths.
  • Updated DB write paths and added a migration to remove the paid column from melt_quotes.
  • Adjusted tests to assert on state instead of deprecated boolean accessors/fields.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/mint/test_mint_api.py Removes obsolete commented assertions around deprecated paid behavior.
tests/fuzz/test_fuzz_core.py Updates fuzz assertions to use state comparisons instead of paid/unpaid/pending accessors.
cashu/wallet/v1_api.py Stops including paid in melt quote request/response field selection.
cashu/mint/router.py Removes paid from API response creation for melt quote retrieval.
cashu/mint/migrations.py Adds migration to remove paid column from melt_quotes (SQLite table rebuild / Postgres DROP COLUMN).
cashu/mint/ledger.py Replaces boolean paid checks with state comparisons.
cashu/mint/crud.py Removes paid column from insert parameters for melt_quotes.
cashu/mint/auth/crud.py Removes paid column usage in insert/update; stores state via .value.
cashu/core/models/melt_quote.py Removes deprecated paid field from PostMeltQuoteResponse.
cashu/core/base.py Removes backwards-compat mapping from legacy paid responses to state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cashu/mint/migrations.py
Comment thread cashu/core/base.py
Comment thread cashu/mint/ledger.py Outdated
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.07%. Comparing base (31e3ae3) to head (1ab1bf4).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1024      +/-   ##
==========================================
+ Coverage   75.03%   75.07%   +0.04%     
==========================================
  Files         111      111              
  Lines       12239    12243       +4     
==========================================
+ Hits         9183     9192       +9     
+ Misses       3056     3051       -5     

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Todo: remove deprecated paid field in MeltQuote

2 participants