mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-24 03:54:21 +01:00
Wallet: store quotes (#657)
* wallet_quotes_wip * fix quote in db * fix subscription test * clean up api * fix api tests * fix balance check
This commit is contained in:
@@ -9,6 +9,8 @@ from httpx import Response
|
||||
from loguru import logger
|
||||
from pydantic import ValidationError
|
||||
|
||||
from cashu.wallet.crud import get_bolt11_melt_quote
|
||||
|
||||
from ..core.base import (
|
||||
BlindedMessage,
|
||||
BlindedSignature,
|
||||
@@ -45,9 +47,6 @@ from ..core.models import (
|
||||
)
|
||||
from ..core.settings import settings
|
||||
from ..tor.tor import TorProxy
|
||||
from .crud import (
|
||||
get_lightning_invoice,
|
||||
)
|
||||
from .wallet_deprecated import LedgerAPIDeprecated
|
||||
|
||||
|
||||
@@ -476,10 +475,10 @@ class LedgerAPI(LedgerAPIDeprecated):
|
||||
# BEGIN backwards compatibility < 0.15.0
|
||||
# assume the mint has not upgraded yet if we get a 404
|
||||
if resp.status_code == 404:
|
||||
invoice = await get_lightning_invoice(id=quote, db=self.db)
|
||||
assert invoice, f"no invoice found for id {quote}"
|
||||
melt_quote = await get_bolt11_melt_quote(quote=quote, db=self.db)
|
||||
assert melt_quote, f"no melt_quote found for id {quote}"
|
||||
ret: PostMeltResponse_deprecated = await self.melt_deprecated(
|
||||
proofs=proofs, outputs=outputs, invoice=invoice.bolt11
|
||||
proofs=proofs, outputs=outputs, invoice=melt_quote.request
|
||||
)
|
||||
elif isinstance(e, ValidationError):
|
||||
# BEGIN backwards compatibility < 0.16.0
|
||||
|
||||
Reference in New Issue
Block a user