Replaces hardcoded 16/32 for LOCATOR lengths

This commit is contained in:
Sergi Delgado Segura
2019-12-05 11:26:58 +01:00
parent bd08b151df
commit b4197aa5bb
6 changed files with 53 additions and 21 deletions

View File

@@ -28,6 +28,8 @@ from apps.cli import (
logger,
)
from common.constants import LOCATOR_LEN_HEX
HTTP_OK = 200
@@ -91,7 +93,7 @@ def load_private_key(sk_pem):
def compute_locator(tx_id):
return tx_id[:32]
return tx_id[:LOCATOR_LEN_HEX]
# returning True or False accordingly.