From b43c01ad8d27f0b7b3726159d22487ff76c35638 Mon Sep 17 00:00:00 2001 From: lollerfirst Date: Sat, 7 Dec 2024 15:59:14 +0100 Subject: [PATCH] remove `mint_quote_signature_required` as per spec --- .env.example | 4 ---- cashu/core/errors.py | 2 +- cashu/core/settings.py | 1 - cashu/mint/ledger.py | 4 ---- 4 files changed, 1 insertion(+), 10 deletions(-) diff --git a/.env.example b/.env.example index c24abbf5..9f857501 100644 --- a/.env.example +++ b/.env.example @@ -131,7 +131,3 @@ LIGHTNING_RESERVE_FEE_MIN=2000 # MINT_GLOBAL_RATE_LIMIT_PER_MINUTE=60 # Determines the number of transactions (mint, melt, swap) allowed per minute per IP # MINT_TRANSACTION_RATE_LIMIT_PER_MINUTE=20 - -# --------- MINT FEATURES --------- -# Require NUT-19 signature for mint quotes -MINT_QUOTE_SIGNATURE_REQUIRED=FALSE diff --git a/cashu/core/errors.py b/cashu/core/errors.py index 284b9dc4..52828221 100644 --- a/cashu/core/errors.py +++ b/cashu/core/errors.py @@ -98,7 +98,7 @@ def __init__(self): super().__init__(self.detail, code=2001) class QuoteInvalidWitnessError(CashuError): - detail = "Witness on mint request not provided or invalid" + detail = "Signature for mint request invalid" code = 20008 def __init__(self): diff --git a/cashu/core/settings.py b/cashu/core/settings.py index a765dad8..029363a1 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -63,7 +63,6 @@ class MintSettings(CashuSettings): mint_input_fee_ppk: int = Field(default=0) mint_disable_melt_on_error: bool = Field(default=False) - mint_quote_signature_required: bool = Field(default=False) class MintDeprecationFlags(MintSettings): diff --git a/cashu/mint/ledger.py b/cashu/mint/ledger.py index 9220484e..24887da6 100644 --- a/cashu/mint/ledger.py +++ b/cashu/mint/ledger.py @@ -39,7 +39,6 @@ NotAllowedError, QuoteInvalidWitnessError, QuoteNotPaidError, - QuoteRequiresPubkeyError, TransactionError, ) from ..core.helpers import sum_proofs @@ -425,9 +424,6 @@ async def mint_quote(self, quote_request: PostMintQuoteRequest) -> MintQuote: if balance + quote_request.amount > settings.mint_max_balance: raise NotAllowedError("Mint has reached maximum balance.") - if settings.mint_quote_signature_required and not quote_request.pubkey: - raise QuoteRequiresPubkeyError() - logger.trace(f"requesting invoice for {unit.str(quote_request.amount)}") invoice_response: InvoiceResponse = await self.backends[method][ unit