Refactors type hints for clarity
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:
parent
429522adba
commit
e8ddc4b697
5 changed files with 122 additions and 115 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue