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

@@ -28,9 +28,8 @@ def generate_dummy_appointment():
current_height = r.json().get("block_count")
dummy_appointment_data = {"tx": hexlify(os.urandom(192)).decode('utf-8'),
"tx_id": hexlify(os.urandom(32)).decode('utf-8'), "start_time": current_height + 5,
"end_time": current_height + 10, "dispute_delta": 20}
dummy_appointment_data = {"tx": os.urandom(192).hex(), "tx_id": os.urandom(32).hex(),
"start_time": current_height + 5, "end_time": current_height + 10, "dispute_delta": 20}
print('Generating dummy appointment data:''\n\n' + json.dumps(dummy_appointment_data, indent=4, sort_keys=True))