mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-21 19:14:19 +01:00
NUT-04 and NUT-05: Add state field to quotes (#560)
* wip adding states, tests failing * add state field to quotes * responses from quotes * store correct state * cleaner test * fix swap check * oops
This commit is contained in:
@@ -2,7 +2,7 @@ import pytest
|
||||
import respx
|
||||
from httpx import Response
|
||||
|
||||
from cashu.core.base import Amount, MeltQuote, Unit
|
||||
from cashu.core.base import Amount, MeltQuote, MeltQuoteState, Unit
|
||||
from cashu.core.models import PostMeltQuoteRequest
|
||||
from cashu.core.settings import settings
|
||||
from cashu.lightning.blink import MINIMUM_FEE_MSAT, BlinkWallet # type: ignore
|
||||
@@ -99,6 +99,7 @@ async def test_blink_pay_invoice():
|
||||
amount=100,
|
||||
fee_reserve=12,
|
||||
paid=False,
|
||||
state=MeltQuoteState.unpaid,
|
||||
)
|
||||
payment = await blink.pay_invoice(quote, 1000)
|
||||
assert payment.ok
|
||||
@@ -131,6 +132,7 @@ async def test_blink_pay_invoice_failure():
|
||||
amount=100,
|
||||
fee_reserve=12,
|
||||
paid=False,
|
||||
state=MeltQuoteState.unpaid,
|
||||
)
|
||||
payment = await blink.pay_invoice(quote, 1000)
|
||||
assert not payment.ok
|
||||
|
||||
Reference in New Issue
Block a user