Skip to content

Commit f249c86

Browse files
committed
fix: cyclo complexity transaction id
Signed-off-by: exploreriii <[email protected]>
1 parent 3f4987e commit f249c86

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hiero_sdk_python/transaction/transaction_id.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import random
1+
import secrets
2+
23
import time
34
from typing import Any, Optional
45
from hiero_sdk_python.hapi.services import basic_types_pb2, timestamp_pb2
@@ -43,7 +44,7 @@ def generate(cls, account_id: AccountId) -> "TransactionId":
4344
Returns:
4445
TransactionId: A new TransactionId instance.
4546
"""
46-
cut_off_seconds: int = random.randint(5, 8) # subtract random number of seconds between 5 and 8
47+
cut_off_seconds = secrets.choice([5, 6, 7, 8])
4748
adjusted_time: float = time.time() - cut_off_seconds
4849
seconds: int = int(adjusted_time)
4950
nanos: int = int((adjusted_time - seconds) * 1e9)

0 commit comments

Comments
 (0)