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 2022-12-29 16:50:05 +01:00
parent c9b02a6470
commit 3d0c66f0f6
No known key found for this signature in database
GPG key ID: 91F3B339B9A02A3D
20 changed files with 31 additions and 33 deletions

View file

@ -215,7 +215,7 @@ async def test_api_payment_with_key(invoice, inkey_headers_from):
@pytest.mark.asyncio
async def test_create_invoice_with_description_hash(client, inkey_headers_to):
data = await get_random_invoice_data()
descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest()
descr_hash = hashlib.sha256("asdasdasd".encode()).hexdigest()
data["description_hash"] = descr_hash
response = await client.post(
@ -232,8 +232,8 @@ async def test_create_invoice_with_description_hash(client, inkey_headers_to):
@pytest.mark.asyncio
async def test_create_invoice_with_unhashed_description(client, inkey_headers_to):
data = await get_random_invoice_data()
descr_hash = hashlib.sha256("asdasdasd".encode("utf-8")).hexdigest()
data["unhashed_description"] = "asdasdasd".encode("utf-8").hex()
descr_hash = hashlib.sha256("asdasdasd".encode()).hexdigest()
data["unhashed_description"] = "asdasdasd".encode().hex()
response = await client.post(
"/api/v1/payments", json=data, headers=inkey_headers_to