Skip to content

Remove paid field in MintQuote#838

Open
KvngMikey wants to merge 10 commits intocashubtc:mainfrom
KvngMikey:deprecate-paid-in-mint
Open

Remove paid field in MintQuote#838
KvngMikey wants to merge 10 commits intocashubtc:mainfrom
KvngMikey:deprecate-paid-in-mint

Conversation

@KvngMikey
Copy link
Contributor

@KvngMikey KvngMikey commented Nov 22, 2025

Fixes #717

Summary

This PR completes the deprecation and removal of the legacy paid boolean field in mint_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.
  • All pytest suites pass successfully with pytest -v.

Copy link
Collaborator

@a1denvalu3 a1denvalu3 left a comment

Choose a reason for hiding this comment

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

I think this should be called "Remove paid field in MintQuote" instead of "Deprecate" because it's already deprecated and we're removing it.

{"secret": proof.secret},
)

async def store_mint_quote(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think there even is a table for mint quotes in the AuthDB. I'm not sure why these functions are even here in the first place. They are not used throughout the codebase.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the function has always existed, are you suggesting it's completely removed from this file ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am suggesting that it has no purpose and shouldn't have existed in the first place. So why even bother fixing it.

@a1denvalu3
Copy link
Collaborator

There are some test failures.

@a1denvalu3 a1denvalu3 force-pushed the deprecate-paid-in-mint branch from 12e3190 to 0a00497 Compare December 17, 2025 12:40
@a1denvalu3
Copy link
Collaborator

Rebased onto main. Tests still failing

@KvngMikey KvngMikey changed the title Deprecate Paid field in MintQuote Remove paid field in MintQuote Dec 17, 2025
@KvngMikey KvngMikey force-pushed the deprecate-paid-in-mint branch 2 times, most recently from 8e53fe8 to 975c383 Compare December 18, 2025 21:16
"WHERE witness IS NOT NULL AND LENGTH(witness) > 1024"
)

async def m030_remove_paid_from_mint_quote(db: Database):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason we don't just ALTER TABLE DROP COLUMN? They introduced that in SQLite version 3.35.0 back in March of 2021.

@TheRealCheebs
Copy link
Contributor

It seems only the postgres tests are failing in CI. I don't see where you are dropping the paid column for postgres, only if conn.type == "SQLITE"

@KvngMikey KvngMikey force-pushed the deprecate-paid-in-mint branch from ece4354 to 4a98d57 Compare January 11, 2026 21:41
@ye0man ye0man added this to nutshell Jan 21, 2026
@github-project-automation github-project-automation bot moved this to Backlog in nutshell Jan 21, 2026
Copy link
Collaborator

@callebtc callebtc left a comment

Choose a reason for hiding this comment

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

Could we also get the issued attribute out in this PR as well?

Comment on lines +460 to +461
# Ensure default fallbacks for backwards compatibility
resp_state = getattr(mint_quote_resp, "state", None) or "unpaid"
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not typesafe

@a1denvalu3
Copy link
Collaborator

@callebtc What issued field are you referring to?

@KvngMikey KvngMikey force-pushed the deprecate-paid-in-mint branch from cdb545e to 8571a90 Compare February 15, 2026 17:14
@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.30%. Comparing base (8748b99) to head (8571a90).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #838      +/-   ##
==========================================
- Coverage   50.02%   49.30%   -0.73%     
==========================================
  Files          89       91       +2     
  Lines       10545    10655     +110     
==========================================
- Hits         5275     5253      -22     
- Misses       5270     5402     +132     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@KvngMikey
Copy link
Contributor Author

@callebtc - recent comments from last meeting addressed, issued field removed and type safety enforced.

cc @a1denvalu3

@KvngMikey KvngMikey force-pushed the deprecate-paid-in-mint branch from d6a9b84 to f72ec34 Compare February 19, 2026 04:01
Comment on lines +460 to +469
# Ensure default fallbacks for backwards compatibility
if isinstance(mint_quote_resp, dict):
resp_state = mint_quote_resp.get("state", "unpaid")
expiry = mint_quote_resp.get("expiry", None)
pubkey = mint_quote_resp.get("pubkey", None)
else:
resp_state = mint_quote_resp.state if hasattr(mint_quote_resp, "state") else "unpaid"
expiry = mint_quote_resp.expiry if hasattr(mint_quote_resp, "expiry") else None
pubkey = mint_quote_resp.pubkey if hasattr(mint_quote_resp, "pubkey") else None

Copy link
Collaborator

Choose a reason for hiding this comment

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

please no hasattr, .get and isinstance

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

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Todo: deprecate paid field in MintQuote

5 participants