Skip to content

Commit 5fb5825

Browse files
tests: move e2e test_blocks
1 parent 31aa6b3 commit 5fb5825

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

tests/e2e_tests/test_blocks.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

tests/e2e_tests/test_metagraph.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os.path
2+
import re
23
import shutil
34
import time
45

@@ -405,3 +406,24 @@ def test_metagraph_info(subtensor, alice_wallet):
405406
metagraph_info = subtensor.get_metagraph_info(netuid=3)
406407

407408
assert metagraph_info is None
409+
410+
411+
def test_blocks(subtensor):
412+
"""
413+
Tests:
414+
- Get current block
415+
- Get block hash
416+
- Wait for block
417+
"""
418+
419+
block = subtensor.get_current_block()
420+
421+
assert block == subtensor.block
422+
423+
block_hash = subtensor.get_block_hash(block)
424+
425+
assert re.match("0x[a-z0-9]{64}", block_hash)
426+
427+
subtensor.wait_for_block(block + 10)
428+
429+
assert subtensor.get_current_block() == block + 10

0 commit comments

Comments
 (0)