11from bittensor .core import async_subtensor as subtensor_module
22from bittensor .core .chain_data import SubnetHyperparameters
33from bittensor .core .async_subtensor import AsyncSubtensor
4- from bittensor .core .extrinsics import async_commit_reveal
4+ from bittensor .core .extrinsics . asyncex import commit_reveal as async_commit_reveal
55import pytest
66import torch
77import numpy as np
8+ from bittensor_wallet import Wallet
89
910
1011@pytest .fixture
@@ -54,7 +55,7 @@ def hyperparams():
5455async def test_do_commit_reveal_v3_success (mocker , subtensor ):
5556 """Test successful commit-reveal with wait for finalization."""
5657 # Preps
57- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
58+ fake_wallet = mocker .Mock (autospec = Wallet )
5859 fake_netuid = 1
5960 fake_commit = b"fake_commit"
6061 fake_reveal_round = 1
@@ -90,7 +91,6 @@ async def test_do_commit_reveal_v3_success(mocker, subtensor):
9091 call = mocked_compose_call .return_value , keypair = fake_wallet .hotkey
9192 )
9293 mocked_submit_extrinsic .assert_awaited_once_with (
93- subtensor = subtensor ,
9494 extrinsic = mocked_create_signed_extrinsic .return_value ,
9595 wait_for_inclusion = False ,
9696 wait_for_finalization = False ,
@@ -102,7 +102,7 @@ async def test_do_commit_reveal_v3_success(mocker, subtensor):
102102async def test_do_commit_reveal_v3_failure_due_to_error (mocker , subtensor ):
103103 """Test commit-reveal fails due to an error in submission."""
104104 # Preps
105- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
105+ fake_wallet = mocker .Mock (autospec = Wallet )
106106 fake_netuid = 1
107107 fake_commit = b"fake_commit"
108108 fake_reveal_round = 1
@@ -149,7 +149,6 @@ async def test_do_commit_reveal_v3_failure_due_to_error(mocker, subtensor):
149149 call = mocked_compose_call .return_value , keypair = fake_wallet .hotkey
150150 )
151151 mocked_submit_extrinsic .assert_awaited_once_with (
152- subtensor = subtensor ,
153152 extrinsic = mocked_create_signed_extrinsic .return_value ,
154153 wait_for_inclusion = True ,
155154 wait_for_finalization = True ,
@@ -164,7 +163,7 @@ async def test_commit_reveal_v3_extrinsic_success_with_torch(
164163):
165164 """Test successful commit-reveal with torch tensors."""
166165 # Preps
167- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
166+ fake_wallet = mocker .Mock (autospec = Wallet )
168167 fake_netuid = 1
169168 fake_uids = torch .tensor ([1 , 2 , 3 ], dtype = torch .int64 )
170169 fake_weights = torch .tensor ([0.1 , 0.2 , 0.7 ], dtype = torch .float32 )
@@ -243,7 +242,7 @@ async def test_commit_reveal_v3_extrinsic_success_with_numpy(
243242):
244243 """Test successful commit-reveal with numpy arrays."""
245244 # Preps
246- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
245+ fake_wallet = mocker .Mock (autospec = Wallet )
247246 fake_netuid = 1
248247 fake_uids = np .array ([1 , 2 , 3 ], dtype = np .int64 )
249248 fake_weights = np .array ([0.1 , 0.2 , 0.7 ], dtype = np .float32 )
@@ -291,7 +290,7 @@ async def test_commit_reveal_v3_extrinsic_response_false(
291290):
292291 """Test unsuccessful commit-reveal with torch."""
293292 # Preps
294- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
293+ fake_wallet = mocker .Mock (autospec = Wallet )
295294 fake_netuid = 1
296295 fake_uids = torch .tensor ([1 , 2 , 3 ], dtype = torch .int64 )
297296 fake_weights = torch .tensor ([0.1 , 0.2 , 0.7 ], dtype = torch .float32 )
@@ -348,7 +347,7 @@ async def test_commit_reveal_v3_extrinsic_response_false(
348347async def test_commit_reveal_v3_extrinsic_exception (mocker , subtensor ):
349348 """Test exception handling in commit-reveal."""
350349 # Preps
351- fake_wallet = mocker .Mock (autospec = subtensor_module . Wallet )
350+ fake_wallet = mocker .Mock (autospec = Wallet )
352351 fake_netuid = 1
353352 fake_uids = [1 , 2 , 3 ]
354353 fake_weights = [0.1 , 0.2 , 0.7 ]
0 commit comments