altered syntax to work with postgres#365
Closed
trbouma wants to merge 2 commits into
Closed
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #365 +/- ##
==========================================
- Coverage 66.31% 66.00% -0.31%
==========================================
Files 68 68
Lines 5219 5160 -59
==========================================
- Hits 3461 3406 -55
+ Misses 1758 1754 -4 ☔ View full report in Codecov by Sentry. |
jooray
added a commit
to jooray/nutshell
that referenced
this pull request
May 10, 2026
Aligns the mint's wire format with the unmerged onchain payment-method NUT (PR cashubtc#365) so wallets implementing it can talk to our mint without zcash-specific glue. Method rename: - backend now registered as Method("onchain") instead of Method("zcash"); the (onchain, zec) method-unit pair signals native Zcash chain. - mint info MintMethodSetting/MeltMethodSetting branch keyed on method.name == "onchain". - All internal MINT_ZCASH_* settings keep their names (they configure the zwalletd backend; only the spec-facing method changes). Router: - router_zcash.py removed; replaced with router_onchain.py serving /v1/{mint,melt}/{quote,}/onchain endpoints. - Mint quote bypasses ledger.mint_quote() so the request can be amount-less per NUT-XX. We allocate a deposit address with amount=0 internally; the running deposit total is polled from the backend on each GET /v1/mint/quote/onchain/{quote} and persisted as MintQuote.amount, surfaced as `amount_paid`. - Mint quote response uses NUT-XX shape: no `state` field; emits `amount_paid` and `amount_issued` (derived from the underlying state machine: amount_issued == amount on ISSUED, amount_paid == amount on PAID/PENDING/ISSUED, both zero on UNPAID). - Mint quote `pubkey` is REQUIRED (Pydantic enforces). - Melt quote response uses NUT-XX shape: `fee_options[]` array (single entry for Zcash's near-flat fee market), `selected_estimated_blocks` (echoed from the wallet's melt request), `outpoint` (txid for both transparent and shielded — see ZCASH-CDK-COMPATIBILITY.md §6.3 for why we don't surface vout). - Melt request requires `estimated_blocks`, validated against the quote's fee_options. Models: - New PostMintQuoteOnchainRequest/Response, PostMeltQuoteOnchainRequest/ Response, PostMeltOnchainRequest, OnchainFeeOption matching XX.md on branch thesimplekid/onchain (commit d76e7e5, last ACK 2026-05-06). Backend: - ZcashBackend.get_deposit_total(checking_id) helper exposes total_confirmed zatoshi for the onchain mint quote accounting. Tests: - All 25 backend tests in test_mint_lightning_zcash.py updated to the onchain method name and pass green. Deviations from NUT-XX still in place (tracked in ZCASH-CDK-COMPATIBILITY.md §6.5): - one mint per quote (cashu ledger marks the quote ISSUED on first mint) - one deposit per quote in practice (first deposit is captured as the full amount; later deposits to the same address bump amount_paid but cannot be minted without lifting the single-mint restriction) - `change` not yet removed from the wider model (NUT-XX forbids it; the decision is still under spec review as of 2026-05-06)
jooray
added a commit
to jooray/nutshell
that referenced
this pull request
May 10, 2026
Aligns the mint's wire format with the unmerged onchain payment-method NUT (PR cashubtc#365) so wallets implementing it can talk to our mint without zcash-specific glue. Method rename: - backend now registered as Method("onchain") instead of Method("zcash"); the (onchain, zec) method-unit pair signals native Zcash chain. - mint info MintMethodSetting/MeltMethodSetting branch keyed on method.name == "onchain". - All internal MINT_ZCASH_* settings keep their names (they configure the zwalletd backend; only the spec-facing method changes). Router: - router_zcash.py removed; replaced with router_onchain.py serving /v1/{mint,melt}/{quote,}/onchain endpoints. - Mint quote bypasses ledger.mint_quote() so the request can be amount-less per NUT-XX. We allocate a deposit address with amount=0 internally; the running deposit total is polled from the backend on each GET /v1/mint/quote/onchain/{quote} and persisted as MintQuote.amount, surfaced as amount_paid. - Mint quote response uses NUT-XX shape: no state field; emits amount_paid and amount_issued (derived from the underlying state machine: amount_issued == amount on ISSUED, amount_paid == amount on PAID/PENDING/ISSUED, both zero on UNPAID). - Mint quote pubkey is REQUIRED (Pydantic enforces). - Melt quote response uses NUT-XX shape: fee_options array (single entry for Zcash near-flat fee market), selected_estimated_blocks (echoed from the wallet melt request), outpoint (txid for both transparent and shielded; we do not surface vout). - Melt request requires estimated_blocks, validated against the quote fee_options. Models: - New PostMintQuoteOnchainRequest/Response, PostMeltQuoteOnchainRequest/ Response, PostMeltOnchainRequest, OnchainFeeOption matching XX.md on branch thesimplekid/onchain (commit d76e7e5, last ACK 2026-05-06). Backend: - ZcashBackend.get_deposit_total(checking_id) helper exposes total_confirmed zatoshi for the onchain mint quote accounting. Tests: - All 25 backend tests in test_mint_lightning_zcash.py updated to the onchain method name and pass green. Deviations from NUT-XX still in place (tracked in ZCASH-CDK-COMPATIBILITY.md §6.5): - one mint per quote (cashu ledger marks the quote ISSUED on first mint) - one deposit per quote in practice (first deposit is captured as the full amount; later deposits to the same address bump amount_paid but cannot be minted without lifting the single-mint restriction) - change not yet removed from the wider model (NUT-XX forbids it; the decision is still under spec review as of 2026-05-06)
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.
I got the following error when attempting to connect to postgres. The error has to do with a syntax variation of where AS should be placed. I fixed by moving the AS clause. It now works with postgres and I tested with SQLite