Updates os.urandom to python3

All string generated with urandom(x) were using binascii + os.urandom + encode. In python3 os.urandom has a hex method.
This commit is contained in:
Sergi Delgado Segura
2019-10-07 11:39:10 +01:00
parent beac88a2c5
commit 5ae210d893
5 changed files with 13 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ def set_up_appointments(total_appointments):
for _ in range(total_appointments):
uuid = uuid4().hex
locator = hexlify(urandom(64))
locator = urandom(32).hex()
appointments[uuid] = Appointment(locator, None, None, None, None, None, None)
locator_uuid_map[locator] = [uuid]
@@ -41,7 +41,7 @@ def set_up_jobs(total_jobs):
for _ in range(total_jobs):
uuid = uuid4().hex
txid = hexlify(urandom(64))
txid = urandom(32).hex()
# Assign both justice_txid and dispute_txid the same id (it shouldn't matter)
jobs[uuid] = Job(txid, txid, None, None, None)