Wallets: add custom invoice expiry (#1396)

* expiry for fakewallet

* expiry for lnd

* lnbits backend

* fix: eclair descriptionHash fixed and expiry added

* cln and sparko

* test expiry

* Eclair from AdminUI and bugfix for nonexistent payments

* add to settings and .env and remove lntxbot

* remove duplicate and format

* add invoice expiry

* add min max and step

* UI works now

* test should fail, sanity check, will revert

* revert, ready for merge

Co-authored-by: Tiago Vasconcelos <talvasconcelos@gmail.com>
This commit is contained in:
calle 2023-01-26 11:08:40 +01:00 committed by GitHub
parent 5a0b217d63
commit f0d58a8365
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 166 additions and 95 deletions

View file

@ -94,6 +94,21 @@ async def test_create_internal_invoice(client, inkey_headers_to):
return invoice
# check POST /api/v1/payments: invoice with custom expiry
@pytest.mark.asyncio
async def test_create_invoice_custom_expiry(client, inkey_headers_to):
data = await get_random_invoice_data()
expiry_seconds = 600 * 6 * 24 * 31 # 31 days in the future
data["expiry"] = expiry_seconds
response = await client.post(
"/api/v1/payments", json=data, headers=inkey_headers_to
)
assert response.status_code == 201
invoice = response.json()
bolt11_invoice = bolt11.decode(invoice["payment_request"])
assert bolt11_invoice.expiry == expiry_seconds
# check POST /api/v1/payments: make payment
@pytest.mark.asyncio
async def test_pay_invoice(client, invoice, adminkey_headers_from):