We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6e54936 commit ef7e291Copy full SHA for ef7e291
pydatastructs/graphs/graph.py
@@ -126,7 +126,9 @@ def add_snapshot(self):
126
}
127
for key, edge in snapshot_copy.edge_weights.items():
128
snapshot_copy.__getattribute__(edge.source.name).add_adjacent_node(edge.target.name)
129
- self.snapshots[timestamp] = snapshot_copy
+ snapshot_data = serialize_graph(snapshot_copy)
130
+ snapshot_signature = generate_hmac(snapshot_data)
131
+ self.snapshots[timestamp] = {"graph": snapshot_copy, "signature": snapshot_signature}
132
def get_snapshot(self, timestamp: int):
133
"""Retrieves a past version of the graph if the timestamp exists."""
134
if timestamp not in self.snapshots:
0 commit comments