Updates tests to use ChainMonitor as global fixture

This commit is contained in:
Sergi Delgado Segura
2020-01-07 16:08:10 +01:00
parent 9bb69d1f5a
commit f10c3c46eb
4 changed files with 13 additions and 20 deletions

View File

@@ -31,7 +31,7 @@ locator_dispute_tx_map = {}
@pytest.fixture(scope="module")
def run_api(db_manager):
def run_api(db_manager, chain_monitor):
sk, pk = generate_keypair()
sk_der = sk.private_bytes(
encoding=serialization.Encoding.DER,
@@ -39,9 +39,6 @@ def run_api(db_manager):
encryption_algorithm=serialization.NoEncryption(),
)
chain_monitor = ChainMonitor()
chain_monitor.monitor_chain()
watcher = Watcher(db_manager, chain_monitor, sk_der)
chain_monitor.attach_watcher(watcher.block_queue, watcher.asleep)
chain_monitor.attach_responder(watcher.responder.block_queue, watcher.responder.asleep)