3
3
4
4
import pytest
5
5
6
- from bittensor import Subtensor , logging
6
+ from bittensor . core . subtensor import Subtensor
7
7
from tests .e2e_tests .utils .chain_interactions import (
8
8
add_stake ,
9
- register_neuron ,
10
9
register_subnet ,
11
10
wait_epoch ,
12
11
)
@@ -38,7 +37,7 @@ async def test_incentive(local_chain):
38
37
AssertionError: If any of the checks or verifications fail
39
38
"""
40
39
41
- logging . info ("Testing test_incentive" )
40
+ print ("Testing test_incentive" )
42
41
netuid = 1
43
42
44
43
# Register root as Alice - the subnet owner and validator
@@ -53,13 +52,18 @@ async def test_incentive(local_chain):
53
52
# Register Bob as miner
54
53
bob_keypair , bob_wallet = setup_wallet ("//Bob" )
55
54
55
+ subtensor = Subtensor (network = "ws://localhost:9945" )
56
+
56
57
# 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"
58
61
59
62
# 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"
61
66
62
- subtensor = Subtensor (network = "ws://localhost:9945" )
63
67
# Assert two neurons are in network
64
68
assert (
65
69
len (subtensor .neurons (netuid = netuid )) == 2
@@ -95,7 +99,7 @@ async def test_incentive(local_chain):
95
99
stdout = asyncio .subprocess .PIPE ,
96
100
stderr = asyncio .subprocess .PIPE ,
97
101
)
98
- logging . info ("Neuron Bob is now mining" )
102
+ print ("Neuron Bob is now mining" )
99
103
await asyncio .sleep (
100
104
5
101
105
) # wait for 5 seconds for the metagraph to refresh with latest data
@@ -127,7 +131,7 @@ async def test_incentive(local_chain):
127
131
stdout = asyncio .subprocess .PIPE ,
128
132
stderr = asyncio .subprocess .PIPE ,
129
133
)
130
- logging . info ("Neuron Alice is now validating" )
134
+ print ("Neuron Alice is now validating" )
131
135
await asyncio .sleep (
132
136
5
133
137
) # wait for 5 seconds for the metagraph and subtensor to refresh with latest data
@@ -163,7 +167,7 @@ async def test_incentive(local_chain):
163
167
wait_for_finalization = True ,
164
168
period = 5 * FAST_BLOCKS_SPEEDUP_FACTOR ,
165
169
)
166
- logging . info ("Alice neuron set weights successfully" )
170
+ print ("Alice neuron set weights successfully" )
167
171
168
172
await wait_epoch (subtensor )
169
173
@@ -183,4 +187,4 @@ async def test_incentive(local_chain):
183
187
assert alice_neuron .stake .tao == 10_000.0
184
188
assert alice_neuron .validator_trust == 1
185
189
186
- logging . info ("✅ Passed test_incentive" )
190
+ print ("✅ Passed test_incentive" )
0 commit comments