12
12
NonAssociatedColdKey ,
13
13
)
14
14
from bittensor .utils .btlogging import logging
15
- from tests .e2e_tests .utils .chain_interactions import (
16
- sudo_set_admin_utils ,
17
- wait_epoch ,
18
- )
15
+ from tests .e2e_tests .utils .chain_interactions import sudo_set_admin_utils
19
16
from tests .e2e_tests .utils .e2e_test_utils import wait_to_start_call
20
17
21
- SET_CHILDREN_COOLDOWN_PERIOD = 15
22
- SET_CHILDREN_RATE_LIMIT = 150
18
+
19
+ SET_CHILDREN_RATE_LIMIT = 15
23
20
24
21
25
22
def test_hotkeys (subtensor , alice_wallet , dave_wallet ):
26
23
"""
27
24
Tests:
28
25
- Check if Hotkey exists
29
26
- Check if Hotkey is registered
30
-
31
27
"""
32
-
33
28
dave_subnet_netuid = subtensor .get_total_subnets () # 2
34
29
assert subtensor .register_subnet (dave_wallet , True , True )
35
30
assert subtensor .subnet_exists (dave_subnet_netuid ), (
@@ -111,15 +106,15 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
111
106
is True
112
107
)
113
108
114
- # assert (
115
- # sudo_set_admin_utils(
116
- # local_chain,
117
- # alice_wallet,
118
- # call_function="sudo_set_tx_rate_limit",
119
- # call_params={"tx_rate_limit": 100 },
120
- # )[0]
121
- # is True
122
- # )
109
+ assert (
110
+ sudo_set_admin_utils (
111
+ local_chain ,
112
+ alice_wallet ,
113
+ call_function = "sudo_set_tx_rate_limit" ,
114
+ call_params = {"tx_rate_limit" : 0 },
115
+ )[0 ]
116
+ is True
117
+ )
123
118
124
119
with pytest .raises (RegistrationNotPermittedOnRootSubnet ):
125
120
subtensor .set_children (
@@ -269,9 +264,8 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
269
264
)
270
265
271
266
assert pending == [(1.0 , bob_wallet .hotkey .ss58_address )]
272
- logging .console .info (f"Cooldown 1 is: { cooldown } " )
273
267
274
- subtensor .wait_for_block (cooldown + 1 )
268
+ subtensor .wait_for_block (cooldown + 15 )
275
269
276
270
success , children , error = subtensor .get_children (
277
271
alice_wallet .hotkey .ss58_address ,
@@ -280,22 +274,24 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
280
274
281
275
assert error == ""
282
276
assert success is True
283
- assert children == [
284
- (
285
- 1.0 ,
286
- bob_wallet .hotkey .ss58_address ,
287
- )
288
- ]
277
+ assert children == [(1.0 , bob_wallet .hotkey .ss58_address )]
289
278
290
279
# pending queue is empty
291
280
pending , cooldown = subtensor .get_children_pending (
292
281
alice_wallet .hotkey .ss58_address ,
293
282
netuid = dave_subnet_netuid ,
294
283
)
295
-
296
284
assert pending == []
297
285
298
286
with pytest .raises (TxRateLimitExceeded ):
287
+ set_children_block = subtensor .get_current_block ()
288
+ subtensor .set_children (
289
+ alice_wallet ,
290
+ alice_wallet .hotkey .ss58_address ,
291
+ netuid = dave_subnet_netuid ,
292
+ children = [],
293
+ raise_error = True ,
294
+ )
299
295
subtensor .set_children (
300
296
alice_wallet ,
301
297
alice_wallet .hotkey .ss58_address ,
@@ -320,8 +316,6 @@ async def test_children(local_chain, subtensor, alice_wallet, bob_wallet, dave_w
320
316
netuid = dave_subnet_netuid ,
321
317
)
322
318
323
- logging .console .info (f"Cooldown 2 is: { cooldown } " )
324
-
325
319
assert pending == []
326
320
327
321
subtensor .wait_for_block (cooldown )
0 commit comments