refactor: purge Quart from the codebase

Most functionality is still broken
This commit is contained in:
Stefan Stammberger
2021-08-27 20:54:42 +02:00
parent ede038976f
commit 3e5af8c1d1
17 changed files with 962 additions and 181 deletions
+5 -6
View File
@@ -5,7 +5,6 @@ from io import BytesIO
from binascii import unhexlify
from typing import Optional, Tuple, Dict
from urllib.parse import urlparse, parse_qs
from quart import g, url_for
from lnurl import LnurlErrorResponse, decode as decode_lnurl # type: ignore
try:
@@ -15,9 +14,10 @@ except ImportError: # pragma: nocover
from lnbits import bolt11
from lnbits.db import Connection
from lnbits.helpers import urlsafe_short_hash
from lnbits.helpers import url_for, urlsafe_short_hash
from lnbits.settings import WALLET
from lnbits.wallets.base import PaymentStatus, PaymentResponse
from lnbits.requestvars import g
from . import db
from .crud import (
@@ -220,10 +220,9 @@ async def redeem_lnurl_withdraw(
try:
params["balanceNotify"] = url_for(
"core.lnurl_balance_notify",
service=urlparse(lnurl_request).netloc,
f"/withdraw/notify/{urlparse(lnurl_request).netloc}",
external=True,
wal=wallet_id,
_external=True,
)
except Exception:
pass
@@ -242,7 +241,7 @@ async def perform_lnurlauth(
cb = urlparse(callback)
k1 = unhexlify(parse_qs(cb.query)["k1"][0])
key = g.wallet.lnurlauth_key(cb.netloc)
key = g().wallet.lnurlauth_key(cb.netloc)
def int_to_bytes_suitable_der(x: int) -> bytes:
"""for strict DER we need to encode the integer with some quirks"""