@@ -13,6 +13,9 @@ def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
1313 weights = []
1414 salt = []
1515
16+ mocked_unlock_key = mocker .patch .object (
17+ mechanism , "unlock_key" , return_value = mocker .Mock (success = True )
18+ )
1619 mocked_get_sub_subnet_storage_index = mocker .patch .object (
1720 mechanism , "get_mechid_storage_index"
1821 )
@@ -34,6 +37,9 @@ def test_commit_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
3437 )
3538
3639 # Asserts
40+ mocked_unlock_key .assert_called_once_with (
41+ wallet = fake_wallet , raise_error = False , unlock_type = "hotkey"
42+ )
3743 mocked_get_sub_subnet_storage_index .assert_called_once_with (
3844 netuid = netuid , mechid = mechid
3945 )
@@ -79,6 +85,9 @@ def test_commit_timelocked_mechanism_weights_extrinsic(mocker, subtensor, fake_w
7985 weights = []
8086 block_time = mocker .Mock ()
8187
88+ mocked_unlock_key = mocker .patch .object (
89+ mechanism , "unlock_key" , return_value = mocker .Mock (success = True )
90+ )
8291 mocked_convert_and_normalize_weights_and_uids = mocker .patch .object (
8392 mechanism ,
8493 "convert_and_normalize_weights_and_uids" ,
@@ -118,6 +127,9 @@ def test_commit_timelocked_mechanism_weights_extrinsic(mocker, subtensor, fake_w
118127 )
119128
120129 # Asserts
130+ mocked_unlock_key .assert_called_once_with (
131+ wallet = fake_wallet , raise_error = False , unlock_type = "hotkey"
132+ )
121133 mocked_convert_and_normalize_weights_and_uids .assert_called_once_with (uids , weights )
122134 mocked_get_sub_subnet_storage_index .assert_called_once_with (
123135 netuid = netuid , mechid = mechid
@@ -169,6 +181,9 @@ def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
169181 weights = []
170182 salt = []
171183
184+ mocked_unlock_key = mocker .patch .object (
185+ mechanism , "unlock_key" , return_value = mocker .Mock (success = True )
186+ )
172187 mocked_convert_and_normalize_weights_and_uids = mocker .patch .object (
173188 mechanism ,
174189 "convert_and_normalize_weights_and_uids" ,
@@ -192,6 +207,9 @@ def test_reveal_mechanism_weights_extrinsic(mocker, subtensor, fake_wallet):
192207 )
193208
194209 # Asserts
210+ mocked_unlock_key .assert_called_once_with (
211+ wallet = fake_wallet , raise_error = False , unlock_type = "hotkey"
212+ )
195213 mocked_convert_and_normalize_weights_and_uids .assert_called_once_with (uids , weights )
196214 mocked_compose_call .assert_called_once_with (
197215 call_module = "SubtensorModule" ,
@@ -229,6 +247,9 @@ def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
229247 uids = []
230248 weights = []
231249
250+ mocked_unlock_key = mocker .patch .object (
251+ mechanism , "unlock_key" , return_value = mocker .Mock (success = True )
252+ )
232253 mocked_convert_and_normalize_weights_and_uids = mocker .patch .object (
233254 mechanism ,
234255 "convert_and_normalize_weights_and_uids" ,
@@ -256,6 +277,9 @@ def test_mechanism_sub_weights_extrinsic(mocker, subtensor, fake_wallet):
256277 )
257278
258279 # Asserts
280+ mocked_unlock_key .assert_called_once_with (
281+ wallet = fake_wallet , raise_error = False , unlock_type = "hotkey"
282+ )
259283 mocked_convert_and_normalize_weights_and_uids .assert_called_once_with (uids , weights )
260284 mocked_compose_call .assert_called_once_with (
261285 call_module = "SubtensorModule" ,
0 commit comments