mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 10:34:20 +01:00
fix: mint and melt quote expiry time (#453)
This commit is contained in:
@@ -183,7 +183,12 @@ async def test_mint_quote(ledger: Ledger):
|
||||
assert result["request"]
|
||||
invoice = bolt11.decode(result["request"])
|
||||
assert invoice.amount_msat == 100 * 1000
|
||||
assert result["expiry"] == invoice.expiry
|
||||
|
||||
expiry = None
|
||||
if invoice.expiry is not None:
|
||||
expiry = invoice.date + invoice.expiry
|
||||
|
||||
assert result["expiry"] == expiry
|
||||
|
||||
# get mint quote again from api
|
||||
response = httpx.get(
|
||||
@@ -246,7 +251,12 @@ async def test_melt_quote_internal(ledger: Ledger, wallet: Wallet):
|
||||
# TODO: internal invoice, fee should be 0
|
||||
assert result["fee_reserve"] == 0
|
||||
invoice_obj = bolt11.decode(request)
|
||||
assert result["expiry"] == invoice_obj.expiry
|
||||
|
||||
expiry = None
|
||||
if invoice_obj.expiry is not None:
|
||||
expiry = invoice_obj.date + invoice_obj.expiry
|
||||
|
||||
assert result["expiry"] == expiry
|
||||
|
||||
# get melt quote again from api
|
||||
response = httpx.get(
|
||||
|
||||
Reference in New Issue
Block a user