6
6
from bittensor .core .chain_data .metagraph_info import MetagraphInfo
7
7
from bittensor .utils .balance import Balance
8
8
from bittensor .utils .btlogging import logging
9
+ from tests .e2e_tests .utils .e2e_test_utils import wait_to_start_call
9
10
10
11
NULL_KEY = tuple (bytearray (32 ))
11
12
@@ -46,7 +47,7 @@ def test_metagraph(subtensor, alice_wallet, bob_wallet, dave_wallet):
46
47
AssertionError: If any of the checks or verifications fail
47
48
"""
48
49
logging .console .info ("Testing test_metagraph_command" )
49
- alice_subnet_netuid = 2
50
+ alice_subnet_netuid = subtensor . get_total_subnets () # 2
50
51
51
52
logging .console .info ("Register the subnet through Alice" )
52
53
assert subtensor .register_subnet (alice_wallet , True , True ), (
@@ -59,8 +60,7 @@ def test_metagraph(subtensor, alice_wallet, bob_wallet, dave_wallet):
59
60
)
60
61
61
62
logging .console .info ("Make sure we passed start_call limit (10 blocks)" )
62
- subtensor .wait_for_block (subtensor .block + 10 )
63
- assert subtensor .start_call (alice_wallet , alice_subnet_netuid , True , True )[0 ]
63
+ assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
64
64
65
65
logging .console .info ("Initialize metagraph" )
66
66
metagraph = subtensor .metagraph (netuid = alice_subnet_netuid )
@@ -196,7 +196,7 @@ def test_metagraph_info(subtensor, alice_wallet, bob_wallet):
196
196
"""
197
197
198
198
alice_subnet_netuid = subtensor .get_total_subnets () # 2
199
- subtensor .register_subnet (alice_wallet )
199
+ subtensor .register_subnet (alice_wallet , True , True )
200
200
201
201
metagraph_info = subtensor .get_metagraph_info (netuid = 1 , block = 1 )
202
202
@@ -370,11 +370,7 @@ def test_metagraph_info(subtensor, alice_wallet, bob_wallet):
370
370
metagraph_info ,
371
371
]
372
372
373
- subtensor .wait_for_block (subtensor .block + 20 )
374
- status , message = subtensor .start_call (
375
- alice_wallet , alice_subnet_netuid , True , True
376
- )
377
- assert status , message
373
+ assert wait_to_start_call (subtensor , alice_wallet , alice_subnet_netuid )
378
374
379
375
assert subtensor .burned_register (
380
376
bob_wallet ,
0 commit comments