feat: preimages for incoming payments, fundingsource saves preimage on create_invoice (#3085)

Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
dni ⚡ 2025-04-30 11:03:19 +02:00 committed by GitHub
parent f8b3644029
commit c4d0540e76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 183 additions and 106 deletions

View file

@ -101,6 +101,8 @@ async def test_create_real_invoice(client, adminkey_headers_from, inkey_headers_
balance = await get_node_balance_sats()
assert balance - prev_balance == create_invoice.amount
assert payment_status.get("preimage") is not None
# exit out of infinite loop
raise FakeError()

View file

@ -17,6 +17,8 @@ async def test_create_invoice(from_wallet):
amount=1000,
memo=description,
)
assert payment.preimage
invoice = decode(payment.bolt11)
assert invoice.payment_hash == payment.payment_hash
assert invoice.amount_msat == 1000000
@ -33,6 +35,8 @@ async def test_create_internal_invoice(from_wallet):
payment = await create_invoice(
wallet_id=from_wallet.id, amount=1000, memo=description, internal=True
)
assert payment.preimage
invoice = decode(payment.bolt11)
assert invoice.payment_hash == payment.payment_hash
assert invoice.amount_msat == 1000000

View file

@ -19,6 +19,7 @@ async def test_services_pay_invoice(to_wallet, real_invoice):
assert payment
assert payment.status == PaymentState.SUCCESS
assert payment.memo == description
assert payment.preimage
@pytest.mark.anyio