remove unnecessary argument encoding from bytes.decode() and str.encode()

the encoding parameter defaults to utf-8, so it's not needed
This commit is contained in:
Pavol Rusnak
2023-01-03 22:38:28 +01:00
parent c9b02a6470
commit 3d0c66f0f6
20 changed files with 31 additions and 33 deletions
+2 -2
View File
@@ -46,8 +46,8 @@ class Wallet(BaseModel):
return ""
def lnurlauth_key(self, domain: str) -> SigningKey:
hashing_key = hashlib.sha256(self.id.encode("utf-8")).digest()
linking_key = hmac.digest(hashing_key, domain.encode("utf-8"), "sha256")
hashing_key = hashlib.sha256(self.id.encode()).digest()
linking_key = hmac.digest(hashing_key, domain.encode(), "sha256")
return SigningKey.from_string(
linking_key, curve=SECP256k1, hashfunc=hashlib.sha256
+1 -1
View File
@@ -536,7 +536,7 @@ async def api_lnurlscan(code: str, wallet: WalletTypeInfo = Depends(get_key_type
params.update(
description_hash=hashlib.sha256(
data["metadata"].encode("utf-8")
data["metadata"].encode()
).hexdigest()
)
metadata = json.loads(data["metadata"])