mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 22:24:23 +01:00
Create common package
Moves cryptographer to common. Also adds constants and defines the leghtn of the locator to avoid hardcoding it in almost every file
This commit is contained in:
@@ -8,6 +8,8 @@ from cryptography.hazmat.primitives import hashes
|
||||
from cryptography.hazmat.primitives.serialization import load_pem_public_key
|
||||
from cryptography.exceptions import InvalidSignature
|
||||
|
||||
from common.constants import LOCATOR_LEN_HEX
|
||||
|
||||
from pisa import errors
|
||||
import pisa.conf as conf
|
||||
from pisa.logger import Logger
|
||||
@@ -64,7 +66,7 @@ class Inspector:
|
||||
rcode = errors.APPOINTMENT_WRONG_FIELD_TYPE
|
||||
message = "wrong locator data type ({})".format(type(locator))
|
||||
|
||||
elif len(locator) != 32:
|
||||
elif len(locator) != LOCATOR_LEN_HEX:
|
||||
rcode = errors.APPOINTMENT_WRONG_FIELD_SIZE
|
||||
message = "wrong locator size ({})".format(len(locator))
|
||||
# TODO: #12-check-txid-regexp
|
||||
|
||||
Reference in New Issue
Block a user