mirror of
https://github.com/aljazceru/python-teos.git
synced 2025-12-17 14:14:22 +01:00
Fixes typos based on @orbitalturtle comments
This commit is contained in:
@@ -20,9 +20,9 @@ class ChainMonitor:
|
||||
|
||||
Attributes:
|
||||
best_tip (:obj:`str`): a block hash representing the current best tip.
|
||||
last_tips (:obj:`list`): a list of last chain tips. Used as an sliding window to avoid notifying about old tips.
|
||||
last_tips (:obj:`list`): a list of last chain tips. Used as a sliding window to avoid notifying about old tips.
|
||||
terminate (:obj:`bool`): a flag to signal the termination of the :class:`ChainMonitor` (shutdown the tower).
|
||||
check_tip (:obj:`Event`): an event that it's triggered at fixed time intervals and controls the polling thread.
|
||||
check_tip (:obj:`Event`): an event that's triggered at fixed time intervals and controls the polling thread.
|
||||
lock (:obj:`Condition`): a lock used to protect concurrent access to the queues and ``best_tip`` by the zmq and
|
||||
polling threads.
|
||||
zmqSubSocket (:obj:`socket`): a socket to connect to ``bitcoind`` via ``zmq``.
|
||||
@@ -130,7 +130,7 @@ class ChainMonitor:
|
||||
while not self.terminate:
|
||||
self.check_tip.wait(timeout=polling_delta)
|
||||
|
||||
# Terminate could have been set wile the thread was blocked in wait
|
||||
# Terminate could have been set while the thread was blocked in wait
|
||||
if not self.terminate:
|
||||
current_tip = BlockProcessor.get_best_block_hash()
|
||||
|
||||
@@ -150,7 +150,7 @@ class ChainMonitor:
|
||||
while not self.terminate:
|
||||
msg = self.zmqSubSocket.recv_multipart()
|
||||
|
||||
# Terminate could have been set wile the thread was blocked in recv
|
||||
# Terminate could have been set while the thread was blocked in recv
|
||||
if not self.terminate:
|
||||
topic = msg[0]
|
||||
body = msg[1]
|
||||
|
||||
@@ -13,7 +13,7 @@ from test.pisa.unit.conftest import get_random_value_hex, generate_block
|
||||
def test_init(run_bitcoind):
|
||||
# run_bitcoind is started here instead of later on to avoid race conditions while it initializes
|
||||
|
||||
# Not much to test here, just sanity checks to make sure nothings goes south in the future
|
||||
# Not much to test here, just sanity checks to make sure nothing goes south in the future
|
||||
chain_monitor = ChainMonitor()
|
||||
|
||||
assert chain_monitor.best_tip is None
|
||||
@@ -70,7 +70,7 @@ def test_notify_subscribers(chain_monitor):
|
||||
chain_monitor.responder_asleep = True
|
||||
chain_monitor.notify_subscribers(new_block)
|
||||
|
||||
# And remain empty afterwards since both subscribers where asleep
|
||||
# And remain empty afterwards since both subscribers were asleep
|
||||
assert chain_monitor.watcher_queue.empty()
|
||||
assert chain_monitor.responder_queue.empty()
|
||||
|
||||
@@ -115,7 +115,7 @@ def test_monitor_chain_polling():
|
||||
polling_thread = Thread(target=chain_monitor.monitor_chain_polling, kwargs={"polling_delta": 0.1}, daemon=True)
|
||||
polling_thread.start()
|
||||
|
||||
# Check that nothings changes as long as a block is not generated
|
||||
# Check that nothing changes as long as a block is not generated
|
||||
for _ in range(5):
|
||||
assert chain_monitor.watcher_queue.empty()
|
||||
time.sleep(0.1)
|
||||
|
||||
Reference in New Issue
Block a user