feat(mint): add method field to quote responses.#1055
Open
KvngMikey wants to merge 2 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a method field (e.g., bolt11) to mint/melt quote responses to expose the payment method through the API while maintaining backward compatibility.
Changes:
- Extend
PostMintQuoteResponseandPostMeltQuoteResponsemodels with an optionalmethodfield. - Populate
methodin mint/melt quote responses in the mint router and ledger. - Update router tests/mocks to include
method="bolt11".
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/mint/test_mint_app_router.py | Updates mocked quote responses to include the new method field. |
| cashu/wallet/v1_api.py | Ensures the melt-quote “include fields” payload includes a method key. |
| cashu/mint/router.py | Exposes method in mint/melt quote API responses. |
| cashu/mint/ledger.py | Propagates method when constructing melt quote responses. |
| cashu/core/models/mint_quote.py | Adds optional method to the mint quote response model. |
| cashu/core/models/melt_quote.py | Adds optional method to the melt quote response model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1055 +/- ##
==========================================
- Coverage 75.15% 75.11% -0.04%
==========================================
Files 111 111
Lines 12372 12374 +2
==========================================
- Hits 9298 9295 -3
- Misses 3074 3079 +5 ☔ View full report in Codecov by Harness. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR aligns the nutshell codebase with the specification change in cashubtc/nuts#387 (add a
methodfield to all quote responses).Changes:
methodproperty to MintQuoteResponse & MeltQuoteResponse making it Optional and None by default to maintain backward compatibility when wallet-side code parses responses from older mints that don't yet send.methodin all manual constructors in therouter.pyandledger.py.test_mint_app_router.pytest file to include method.