Refactors type hints for clarity
Some checks failed
CI / lint (push) Has been cancelled
/ release (push) Has been cancelled
/ pullrequest (push) Has been cancelled

Updates type hints in `crud.py`, `helpers.py`, and `models.py` for improved readability and maintainability.

Replaces `Merchant | None` with `Optional[Merchant]` and `list[X]` with `List[X]` for consistency with standard Python typing practices.
This commit is contained in:
padreug 2025-11-04 00:59:55 +01:00
parent 429522adba
commit e8ddc4b697
5 changed files with 122 additions and 115 deletions

View file

@ -1,5 +1,6 @@
import base64
import secrets
from typing import Optional
import secp256k1
from bech32 import bech32_decode, convertbits
@ -32,7 +33,7 @@ def decrypt_message(encoded_message: str, encryption_key) -> str:
return unpadded_data.decode()
def encrypt_message(message: str, encryption_key, iv: bytes | None = None) -> str:
def encrypt_message(message: str, encryption_key, iv: Optional[bytes] = None) -> str:
padder = padding.PKCS7(128).padder()
padded_data = padder.update(message.encode()) + padder.finalize()