Tests: hold invoice tests pending during payment (#1839)

* tests: hold invoice tests pending during payment

* sigh...

* ok

* hash preimage

* preimage_hash == payment_hash

* should error

* check that payment is gone

* cancel task while in-flight

* lnbits endpoing return error

* return error

* add both options

* fix list

* respond to error

* return false if payment status errors

* outgoing invoice should be deleted after one status check

* test api_payments_create error
This commit is contained in:
callebtc
2023-07-31 20:25:22 +02:00
committed by GitHub
parent 1ab81f6d7e
commit 9f40b3cdbd
2 changed files with 110 additions and 7 deletions
+2 -2
View File
@@ -99,7 +99,7 @@ class LNbitsWallet(Wallet):
if r.is_error:
error_message = r.json()["detail"]
return PaymentResponse(None, None, None, None, error_message)
return PaymentResponse(False, None, None, None, error_message)
else:
data = r.json()
checking_id = data["payment_hash"]
@@ -124,7 +124,7 @@ class LNbitsWallet(Wallet):
r = await self.client.get(url=f"/api/v1/payments/{checking_id}")
if r.is_error:
return PaymentStatus(None)
return PaymentStatus(False)
data = r.json()
if "paid" not in data and "details" not in data:
return PaymentStatus(None)