33
44import pytest
55
6- from bittensor import Subtensor , logging
6+ from bittensor . core . subtensor import Subtensor
77from tests .e2e_tests .utils .chain_interactions import (
88 add_stake ,
9- register_neuron ,
109 register_subnet ,
1110 wait_epoch ,
1211)
@@ -38,7 +37,7 @@ async def test_incentive(local_chain):
3837 AssertionError: If any of the checks or verifications fail
3938 """
4039
41- logging . info ("Testing test_incentive" )
40+ print ("Testing test_incentive" )
4241 netuid = 1
4342
4443 # Register root as Alice - the subnet owner and validator
@@ -53,13 +52,18 @@ async def test_incentive(local_chain):
5352 # Register Bob as miner
5453 bob_keypair , bob_wallet = setup_wallet ("//Bob" )
5554
55+ subtensor = Subtensor (network = "ws://localhost:9945" )
56+
5657 # Register Alice as a neuron on the subnet
57- register_neuron (local_chain , alice_wallet , netuid )
58+ assert subtensor .burned_register (
59+ alice_wallet , netuid
60+ ), "Unable to register Alice as a neuron"
5861
5962 # Register Bob as a neuron on the subnet
60- register_neuron (local_chain , bob_wallet , netuid )
63+ assert subtensor .burned_register (
64+ bob_wallet , netuid
65+ ), "Unable to register Bob as a neuron"
6166
62- subtensor = Subtensor (network = "ws://localhost:9945" )
6367 # Assert two neurons are in network
6468 assert (
6569 len (subtensor .neurons (netuid = netuid )) == 2
@@ -95,7 +99,7 @@ async def test_incentive(local_chain):
9599 stdout = asyncio .subprocess .PIPE ,
96100 stderr = asyncio .subprocess .PIPE ,
97101 )
98- logging . info ("Neuron Bob is now mining" )
102+ print ("Neuron Bob is now mining" )
99103 await asyncio .sleep (
100104 5
101105 ) # wait for 5 seconds for the metagraph to refresh with latest data
@@ -127,7 +131,7 @@ async def test_incentive(local_chain):
127131 stdout = asyncio .subprocess .PIPE ,
128132 stderr = asyncio .subprocess .PIPE ,
129133 )
130- logging . info ("Neuron Alice is now validating" )
134+ print ("Neuron Alice is now validating" )
131135 await asyncio .sleep (
132136 5
133137 ) # wait for 5 seconds for the metagraph and subtensor to refresh with latest data
@@ -163,7 +167,7 @@ async def test_incentive(local_chain):
163167 wait_for_finalization = True ,
164168 period = 5 * FAST_BLOCKS_SPEEDUP_FACTOR ,
165169 )
166- logging . info ("Alice neuron set weights successfully" )
170+ print ("Alice neuron set weights successfully" )
167171
168172 await wait_epoch (subtensor )
169173
@@ -183,4 +187,4 @@ async def test_incentive(local_chain):
183187 assert alice_neuron .stake .tao == 10_000.0
184188 assert alice_neuron .validator_trust == 1
185189
186- logging . info ("✅ Passed test_incentive" )
190+ print ("✅ Passed test_incentive" )
0 commit comments