6
6
)
7
7
8
8
9
+ SET_CHILDREN_COOLDOWN_PERIOD = 15
9
10
SET_CHILDREN_RATE_LIMIT = 150
10
11
11
12
@@ -54,17 +55,13 @@ def test_hotkeys(subtensor, alice_wallet):
54
55
)
55
56
56
57
57
- @pytest .mark .skip (
58
- reason = """The behavior of set_children changes: Instead of setting children immediately, the children will be set in the subnet epoch after a cool down period (7200 blocks).
59
- https://github.com/opentensor/subtensor/pull/1050
60
- """ ,
61
- )
62
58
@pytest .mark .asyncio
63
59
async def test_children (subtensor , alice_wallet , bob_wallet ):
64
60
"""
65
61
Tests:
66
62
- Get default children (empty list)
67
63
- Update children list
64
+ - Checking cooldown period
68
65
- Trigger rate limit
69
66
- Clear children list
70
67
"""
@@ -102,6 +99,20 @@ async def test_children(subtensor, alice_wallet, bob_wallet):
102
99
assert error == ""
103
100
assert success is True
104
101
102
+ set_children_block = subtensor .get_current_block ()
103
+
104
+ success , children , error = subtensor .get_children (
105
+ alice_wallet .hotkey .ss58_address ,
106
+ block = set_children_block ,
107
+ netuid = 1 ,
108
+ )
109
+
110
+ assert success is True
111
+ assert children == []
112
+ assert error == ""
113
+
114
+ subtensor .wait_for_block (set_children_block + SET_CHILDREN_COOLDOWN_PERIOD )
115
+
105
116
await wait_epoch (subtensor , netuid = 1 )
106
117
107
118
success , children , error = subtensor .get_children (
@@ -128,7 +139,7 @@ async def test_children(subtensor, alice_wallet, bob_wallet):
128
139
assert "`TxRateLimitExceeded(Module)`" in error
129
140
assert success is False
130
141
131
- subtensor .wait_for_block (subtensor . block + SET_CHILDREN_RATE_LIMIT )
142
+ subtensor .wait_for_block (set_children_block + SET_CHILDREN_RATE_LIMIT )
132
143
133
144
success , error = set_children (
134
145
subtensor ,
0 commit comments