Skip to content

Commit 54a1f19

Browse files
committed
Parity updated checksum from md5 to sha256
1 parent 33c1f80 commit 54a1f19

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

tests/integration/parity/install_parity.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ def install_parity(version_string):
7373
uri, checksum = get_uri(**params)[0]
7474

7575
if not os.path.exists(path):
76-
download_binary(path, uri, checksum)
76+
try:
77+
download_binary(path, uri, checksum)
78+
except AssertionError as exc:
79+
raise Exception("failed to download binary at uri %r with params %r" % (
80+
uri,
81+
params,
82+
)) from exc
7783

7884
return path
7985

@@ -82,7 +88,7 @@ def download_binary(path, uri, checksum):
8288
r = get_binary_stream(uri)
8389
total_size = int(r.headers.get('content-length', 0))
8490
os.makedirs(os.path.dirname(path), exist_ok=True)
85-
digest = hashlib.md5()
91+
digest = hashlib.sha256()
8692
with open(path, 'wb') as f:
8793
with tqdm(total=total_size,
8894
unit='B',
@@ -92,7 +98,8 @@ def download_binary(path, uri, checksum):
9298
f.write(data)
9399
pbar.update(len(data))
94100
digest.update(data)
95-
assert digest.hexdigest() == checksum
101+
hex_digest = digest.hexdigest()
102+
assert hex_digest == checksum, "digest vs checksum: %r vs %r" % (hex_digest, checksum)
96103
chmod_plus_x(path)
97104

98105

0 commit comments

Comments
 (0)