SabaPivot's picture
Upgrade canonical logbook from stronger peer evidence with attribution
9b57190 verified
Raw
History Blame Contribute Delete
545 Bytes
#!/usr/bin/env python3
import hashlib, json
from pathlib import Path
r=Path(__file__).resolve().parent
record=json.loads((r/'source_record.json').read_text())
assert record['official_repo_commit']=='dc0adebd2466cb862879ba309b30e66a37b10473'
for item in record['files']:
p=r/item['path']; assert p.is_file() and p.stat().st_size==item['bytes']; assert hashlib.sha256(p.read_bytes()).hexdigest()==item['sha256']
print(json.dumps({'files':len(record['files']),'all_hashes_exact':True,'repo_commit':record['official_repo_commit']},sort_keys=True))