1
1
import asyncio
2
- import time
3
2
4
3
import pytest
5
4
@@ -23,9 +22,6 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
23
22
AssertionError: If any of the checks or verifications fail
24
23
"""
25
24
26
- # Wait for 2 tempos to spin up chain properly
27
- subtensor .wait_for_block (20 )
28
-
29
25
print ("Testing test_incentive" )
30
26
netuid = 2
31
27
@@ -51,15 +47,13 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
51
47
# Get current miner/validator stats
52
48
alice_neuron = metagraph .neurons [0 ]
53
49
54
- time .sleep (30 )
55
50
assert alice_neuron .validator_permit is True
56
51
assert alice_neuron .dividends == 0
57
52
assert alice_neuron .stake .tao > 0
58
53
assert alice_neuron .validator_trust == 0
59
54
60
55
bob_neuron = metagraph .neurons [1 ]
61
56
62
- time .sleep (30 )
63
57
assert bob_neuron .incentive == 0
64
58
assert bob_neuron .consensus == 0
65
59
assert bob_neuron .rank == 0
@@ -79,15 +73,14 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
79
73
# wait for the Validator to process and set_weights
80
74
await asyncio .sleep (5 )
81
75
82
- # Wait until next epoch
83
- await wait_epoch (subtensor , netuid )
76
+ # Wait few epochs
77
+ await wait_epoch (subtensor , netuid , times = 4 )
84
78
85
79
# Refresh metagraph
86
80
metagraph = subtensor .metagraph (netuid )
87
81
88
82
# Get current emissions and validate that Alice has gotten tao
89
83
alice_neuron = metagraph .neurons [0 ]
90
- time .sleep (5 )
91
84
92
85
assert alice_neuron .validator_permit is True
93
86
assert alice_neuron .dividends == 1.0
0 commit comments