[CHORE] update dependencies, unsafe pip packages, fastapi (#1609)

* d

* middleware needs to be initialised before startup

runs on python3.11

update secp256k1

update psycopg

* update fastapi to v0.103

* fix webpush

* bump dependencies

* ruff issue

* lock versions

* bump versions

---------

Co-authored-by: jacksn <jkranawetter05@gmail.com>
This commit is contained in:
dni ⚡
2023-09-25 10:54:02 +01:00
committed by GitHub
co-authored by jacksn
parent d3d1010360
commit a8082f798f
7 changed files with 971 additions and 837 deletions
+5 -2
View File
@@ -1,4 +1,7 @@
from typing import Union
from bech32 import bech32_decode, bech32_encode, convertbits
from fastapi.datastructures import URL
def decode(lnurl: str) -> str:
@@ -10,8 +13,8 @@ def decode(lnurl: str) -> str:
return bytes(bech32_data).decode()
def encode(url: str) -> str:
bech32_data = convertbits(url.encode(), 8, 5, True)
def encode(url: Union[str, URL]) -> str:
bech32_data = convertbits(str(url).encode(), 8, 5, True)
assert bech32_data
lnurl = bech32_encode("lnurl", bech32_data)
return lnurl.upper()