chore: update github workflows

This commit is contained in:
Eneko Illarramendi
2020-09-03 23:10:41 +02:00
parent a651f747ac
commit 23cfe0d417
23 changed files with 199 additions and 91 deletions
+5 -1
View File
@@ -22,7 +22,11 @@ class LNbitsWallet(Wallet):
else:
data["memo"] = memo or ""
r = post(url=f"{self.endpoint}/api/v1/payments", headers=self.auth_invoice, json=data,)
r = post(
url=f"{self.endpoint}/api/v1/payments",
headers=self.auth_invoice,
json=data,
)
ok, checking_id, payment_request, error_message = r.ok, None, None, None
if r.ok:
+3 -1
View File
@@ -55,7 +55,9 @@ class LndWallet(Wallet):
grpc_port=self.port,
)
payinvoice = lnd_rpc.pay_invoice(payment_request=bolt11,)
payinvoice = lnd_rpc.pay_invoice(
payment_request=bolt11,
)
ok, checking_id, fee_msat, error_message = True, None, 0, None
+21 -4
View File
@@ -30,7 +30,12 @@ class LndRestWallet(Wallet):
else:
data["memo"] = memo or ""
r = post(url=f"{self.endpoint}/v1/invoices", headers=self.auth_invoice, verify=self.auth_cert, json=data,)
r = post(
url=f"{self.endpoint}/v1/invoices",
headers=self.auth_invoice,
verify=self.auth_cert,
json=data,
)
ok, checking_id, payment_request, error_message = r.ok, None, None, None
@@ -38,7 +43,11 @@ class LndRestWallet(Wallet):
data = r.json()
payment_request = data["payment_request"]
r = get(url=f"{self.endpoint}/v1/payreq/{payment_request}", headers=self.auth_read, verify=self.auth_cert,)
r = get(
url=f"{self.endpoint}/v1/payreq/{payment_request}",
headers=self.auth_read,
verify=self.auth_cert,
)
print(r)
if r.ok:
checking_id = r.json()["payment_hash"].replace("/", "_")
@@ -56,7 +65,11 @@ class LndRestWallet(Wallet):
json={"payment_request": bolt11},
)
ok, checking_id, fee_msat, error_message = r.ok, None, 0, None
r = get(url=f"{self.endpoint}/v1/payreq/{bolt11}", headers=self.auth_admin, verify=self.auth_cert,)
r = get(
url=f"{self.endpoint}/v1/payreq/{bolt11}",
headers=self.auth_admin,
verify=self.auth_cert,
)
if r.ok:
checking_id = r.json()["payment_hash"]
@@ -68,7 +81,11 @@ class LndRestWallet(Wallet):
def get_invoice_status(self, checking_id: str) -> PaymentStatus:
checking_id = checking_id.replace("_", "/")
print(checking_id)
r = get(url=f"{self.endpoint}/v1/invoice/{checking_id}", headers=self.auth_invoice, verify=self.auth_cert,)
r = get(
url=f"{self.endpoint}/v1/invoice/{checking_id}",
headers=self.auth_invoice,
verify=self.auth_cert,
)
print(r.json()["settled"])
if not r or r.json()["settled"] == False:
return PaymentStatus(None)
+5 -1
View File
@@ -25,7 +25,11 @@ class LNPayWallet(Wallet):
else:
data["memo"] = memo or ""
r = post(url=f"{self.endpoint}/user/wallet/{self.auth_invoice}/invoice", headers=self.auth_api, json=data,)
r = post(
url=f"{self.endpoint}/user/wallet/{self.auth_invoice}/invoice",
headers=self.auth_api,
json=data,
)
ok, checking_id, payment_request, error_message = r.status_code == 201, None, None, r.text
if ok:
+5 -1
View File
@@ -23,7 +23,11 @@ class LntxbotWallet(Wallet):
else:
data["memo"] = memo or ""
r = post(url=f"{self.endpoint}/addinvoice", headers=self.auth_invoice, json=data,)
r = post(
url=f"{self.endpoint}/addinvoice",
headers=self.auth_invoice,
json=data,
)
ok, checking_id, payment_request, error_message = r.ok, None, None, None
if r.ok:
+3 -1
View File
@@ -48,7 +48,9 @@ class SparkWallet(Wallet):
try:
if description_hash:
r = self.invoicewithdescriptionhash(
msatoshi=amount * 1000, label=label, description_hash=description_hash.hex(),
msatoshi=amount * 1000,
label=label,
description_hash=description_hash.hex(),
)
else:
r = self.invoice(