Skip to content

Commit f2f2e60

Browse files
committed
Added test for wait_for_block
1 parent 33f6573 commit f2f2e60

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/integration_tests/test_async_substrate_interface.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,3 +328,19 @@ async def concurrent_task(substrate, task_id):
328328
await asyncio.gather(*tasks)
329329

330330
print("test_concurrent_rpc_requests succeeded")
331+
332+
333+
@pytest.mark.asyncio
334+
async def test_wait_for_block():
335+
async def handler(_):
336+
return True
337+
338+
substrate = AsyncSubstrateInterface(
339+
LATENT_LITE_ENTRYPOINT, ss58_format=42, chain_name="Bittensor"
340+
)
341+
await substrate.initialize()
342+
current_block = await substrate.get_block_number(None)
343+
result = await substrate.wait_for_block(
344+
current_block + 3, result_handler=handler, task_return=False
345+
)
346+
assert result is True

0 commit comments

Comments
 (0)