Skip to content

Commit 6b4dbf4

Browse files
author
Roman
committed
update test_hotkeys.py
1 parent 6667aec commit 6b4dbf4

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

tests/e2e_tests/test_hotkeys.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_hotkeys(subtensor, alice_wallet, dave_wallet):
1818
- Check if Hotkey is registered
1919
"""
2020

21-
dave_subnet_netuid = 2
21+
dave_subnet_netuid = subtensor.get_total_subnets() # 2
2222
assert subtensor.register_subnet(dave_wallet, True, True)
2323
assert subtensor.subnet_exists(dave_subnet_netuid), (
2424
f"Subnet #{dave_subnet_netuid} does not exist."
@@ -76,14 +76,26 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
7676
- Clear children list
7777
"""
7878

79-
dave_subnet_netuid = 2
79+
dave_subnet_netuid = subtensor.get_total_subnets() # 2
80+
set_tempo = 10
8081
assert subtensor.register_subnet(dave_wallet, True, True)
8182
assert subtensor.subnet_exists(dave_subnet_netuid), (
8283
f"Subnet #{dave_subnet_netuid} does not exist."
8384
)
8485

8586
assert wait_to_start_call(subtensor, dave_wallet, dave_subnet_netuid)
8687

88+
# set the same tempo for both type of nodes (to avoid tests timeout)
89+
assert (
90+
sudo_set_admin_utils(
91+
local_chain,
92+
alice_wallet,
93+
call_function="sudo_set_tempo",
94+
call_params={"netuid": dave_subnet_netuid, "tempo": set_tempo},
95+
)[0]
96+
is True
97+
)
98+
8799
with pytest.raises(bittensor.RegistrationNotPermittedOnRootSubnet):
88100
subtensor.set_children(
89101
alice_wallet,
@@ -235,10 +247,11 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
235247
"5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty",
236248
),
237249
]
250+
bittensor.logging.console.info(f"cooldown: {cooldown}")
238251

239252
subtensor.wait_for_block(cooldown)
240253

241-
await wait_epoch(subtensor, netuid=1)
254+
await wait_epoch(subtensor, netuid=dave_subnet_netuid)
242255

243256
success, children, error = subtensor.get_children(
244257
alice_wallet.hotkey.ss58_address,

0 commit comments

Comments
 (0)