1
1
import asyncio
2
+
2
3
import pytest
3
4
5
+ from bittensor .utils .balance import Balance
4
6
from tests .e2e_tests .utils .chain_interactions import (
5
7
wait_epoch ,
6
8
sudo_set_hyperparameter_values ,
7
9
)
10
+ from tests .e2e_tests .utils .e2e_test_utils import wait_to_start_call
8
11
9
12
FAST_BLOCKS_SPEEDUP_FACTOR = 5
10
13
@@ -58,9 +61,9 @@ async def test_root_reg_hyperparams(
58
61
"""
59
62
60
63
print ("Testing root register, weights, and hyperparams" )
61
- netuid = 2
64
+ netuid = subtensor . get_total_subnets () # 2
62
65
63
- # Default immunity period & tempo set through the subtensor side
66
+ # Default immunity period and tempo set through the subtensor side
64
67
default_immunity_period = 5000
65
68
default_tempo = 10 if subtensor .is_fast_blocks () else 360
66
69
@@ -79,10 +82,22 @@ async def test_root_reg_hyperparams(
79
82
# Create netuid = 2
80
83
assert subtensor .register_subnet (alice_wallet )
81
84
82
- # Ensure correct immunity period & tempo is being fetched
85
+ assert wait_to_start_call (subtensor = subtensor , subnet_owner_wallet = alice_wallet , netuid = netuid )
86
+
87
+ # Ensure correct immunity period and tempo is being fetched
83
88
assert subtensor .immunity_period (netuid = netuid ) == default_immunity_period
84
89
assert subtensor .tempo (netuid = netuid ) == default_tempo
85
90
91
+ assert subtensor .add_stake (
92
+ wallet = bob_wallet ,
93
+ hotkey_ss58 = alice_wallet .hotkey .ss58_address ,
94
+ netuid = netuid ,
95
+ amount = Balance .from_tao (1 ),
96
+ wait_for_inclusion = True ,
97
+ wait_for_finalization = True ,
98
+ period = 16 ,
99
+ ), "Unable to stake from Bob to Alice"
100
+
86
101
async with templates .validator (alice_wallet , netuid ):
87
102
await asyncio .sleep (5 ) # Wait a bit for chain to process data
88
103
0 commit comments