def _cbCallUpdateBridgeHistory(self, d, splitter): """Fake some timestamps for the bridges in the splitter, and then call Main.updateBridgeHistory(). """ def timestamp(): return datetime.fromtimestamp(random.randint(1324285117, 1524285117)) bridges = splitter._bridges timestamps = {} for fingerprint, _ in bridges.items(): timestamps[fingerprint] = [timestamp(), timestamp(), timestamp()] return Main.updateBridgeHistory(bridges, timestamps)
def _cbCallUpdateBridgeHistory(self, d, splitter): """Fake some timestamps for the bridges in the splitter, and then call Main.updateBridgeHistory(). """ def timestamp(): return datetime.fromtimestamp( random.randint(1324285117, 1524285117)) bridges = splitter._bridges timestamps = {} for fingerprint, _ in bridges.items(): timestamps[fingerprint] = [timestamp(), timestamp(), timestamp()] return Main.updateBridgeHistory(bridges, timestamps)