fix validation rules so description_hash works.

This commit is contained in:
fiatjaf
2020-07-04 22:28:08 -03:00
parent bc27293315
commit 24dc6e5415
6 changed files with 9 additions and 17 deletions
+1 -7
View File
@@ -1,6 +1,5 @@
from os import getenv
from requests import get, post
from binascii import hexlify
from .base import InvoiceResponse, PaymentResponse, PaymentStatus, Wallet
@@ -17,12 +16,7 @@ class LNbitsWallet(Wallet):
r = post(
url=f"{self.endpoint}/api/v1/payments",
headers=self.auth_invoice,
json={
"out": False,
"amount": amount,
"memo": memo,
"description_hash": hexlify(description_hash).decode("ascii"),
},
json={"out": False, "amount": amount, "memo": memo, "description_hash": description_hash.hex(),},
)
ok, checking_id, payment_request, error_message = r.ok, None, None, None
+1 -2
View File
@@ -1,6 +1,5 @@
from os import getenv
from requests import post
from binascii import hexlify
from .base import InvoiceResponse, PaymentResponse, PaymentStatus, Wallet
@@ -18,7 +17,7 @@ class LntxbotWallet(Wallet):
r = post(
url=f"{self.endpoint}/addinvoice",
headers=self.auth_invoice,
json={"amt": str(amount), "memo": memo, "description_hash": hexlify(description_hash).decode("ascii")},
json={"amt": str(amount), "memo": memo, "description_hash": description_hash.hex()},
)
ok, checking_id, payment_request, error_message = r.ok, None, None, None