We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9eff90b commit 403c936Copy full SHA for 403c936
pydatastructs/graphs/graph.py
@@ -139,7 +139,9 @@ def get_snapshot(self, timestamp: int):
139
stored_signature = snapshot_info["signature"]
140
snapshot_data = serialize_graph(snapshot_graph)
141
computed_signature = generate_hmac(snapshot_data)
142
-
+ if computed_signature != stored_signature:
143
+ raise ValueError("Snapshot integrity check failed! The snapshot may have been modified.")
144
+ return snapshot_graph
145
def list_snapshots(self):
146
"""Returns all stored timestamps in sorted order."""
147
return sorted(self.snapshots.keys())
0 commit comments