Skip to content

Commit 9eff90b

Browse files
Serialize the snapshot for HMAC verification
1 parent a1d6c80 commit 9eff90b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pydatastructs/graphs/graph.py

+3
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ def get_snapshot(self, timestamp: int):
137137
snapshot_info = self.snapshots[timestamp]
138138
snapshot_graph = snapshot_info["graph"]
139139
stored_signature = snapshot_info["signature"]
140+
snapshot_data = serialize_graph(snapshot_graph)
141+
computed_signature = generate_hmac(snapshot_data)
142+
140143
def list_snapshots(self):
141144
"""Returns all stored timestamps in sorted order."""
142145
return sorted(self.snapshots.keys())

0 commit comments

Comments
 (0)