|
1 | 1 | import asyncio |
2 | 2 | import collections |
3 | | -from typing import Optional, Sequence, Iterable |
| 3 | +from typing import Optional, Sequence, Iterable, Mapping |
4 | 4 |
|
5 | 5 | import aiorpcx |
6 | 6 | from aiorpcx import RPCError |
@@ -99,7 +99,7 @@ def get_local_height(self) -> int: |
99 | 99 |
|
100 | 100 |
|
101 | 101 | # regtest chain: |
102 | | -BLOCK_HEADERS = { |
| 102 | +BLOCK_HEADERS: Mapping[int, bytes] = { |
103 | 103 | 0: bfh("0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff7f2002000000"), |
104 | 104 | 1: bfh("0000002006226e46111a0b59caaf126043eb5bbf28c34f3a5e332a1fc7b2b73cf188910f186c8dfd970a4545f79916bc1d75c9d00432f57c89209bf3bb115b7612848f509c25f45bffff7f2000000000"), |
105 | 105 | 2: bfh("00000020686bdfc6a3db73d5d93e8c9663a720a26ecb1ef20eb05af11b36cdbc57c19f7ebf2cbf153013a1c54abaf70e95198fcef2f3059cc6b4d0f7e876808e7d24d11cc825f45bffff7f2000000000"), |
@@ -333,8 +333,9 @@ async def asyncTearDown(self): |
333 | 333 | async def _start_iface_and_wait_for_sync(self): |
334 | 334 | interface = Interface(network=self.network, server=ServerAddr(host="127.0.0.1", port=self._server_port, protocol="t")) |
335 | 335 | self.network.interface = interface |
336 | | - await util.wait_for2(interface.ready, 5) |
337 | | - await interface._blockchain_updated.wait() |
| 336 | + async with util.async_timeout(5): |
| 337 | + await interface.ready |
| 338 | + await interface._blockchain_updated.wait() |
338 | 339 | return interface |
339 | 340 |
|
340 | 341 | async def test_client_syncs_headers_to_tip(self): |
|
0 commit comments