From 1a26d7d6a3418f3d9d79c5e46beeee45fd6b1a2c Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Mon, 13 Jan 2020 15:31:54 +0100 Subject: [PATCH] Fixes typos based on @orbitalturtle comments --- pisa/chain_monitor.py | 8 ++++---- test/pisa/unit/test_chain_monitor.py | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pisa/chain_monitor.py b/pisa/chain_monitor.py index 087096b..6327692 100644 --- a/pisa/chain_monitor.py +++ b/pisa/chain_monitor.py @@ -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] diff --git a/test/pisa/unit/test_chain_monitor.py b/test/pisa/unit/test_chain_monitor.py index d3037d8..4e8cdfb 100644 --- a/test/pisa/unit/test_chain_monitor.py +++ b/test/pisa/unit/test_chain_monitor.py @@ -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)