Skip to content

Commit 4640d49

Browse files
author
Roman
committed
improve test SelectiveMetagraph (validators) in tests/e2e_tests/test_incentive.py
1 parent f44b826 commit 4640d49

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

tests/e2e_tests/test_incentive.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,25 @@ async def test_incentive(local_chain, subtensor, templates, alice_wallet, bob_wa
103103
continue
104104
raise
105105

106-
# wait one tempo (fast block
107-
subtensor.wait_for_block(subtensor.block + subtensor.tempo(alice_subnet_netuid))
106+
# wait one tempo (fast block)
107+
next_epoch_start_block = subtensor.subnets.get_next_epoch_start_block(
108+
alice_subnet_netuid
109+
)
110+
subtensor.wait_for_block(next_epoch_start_block + tempo + 1)
111+
112+
validators = subtensor.metagraphs.get_metagraph_info(
113+
alice_subnet_netuid, field_indices=[72]
114+
).validators
108115

109116
alice_uid = subtensor.subnets.get_uid_for_hotkey_on_subnet(
110117
hotkey_ss58=alice_wallet.hotkey.ss58_address, netuid=alice_subnet_netuid
111118
)
112-
assert (
113-
subtensor.metagraphs.get_metagraph_info(
114-
alice_subnet_netuid, field_indices=[72]
115-
).validators[alice_uid]
116-
== 1
117-
)
119+
assert validators[alice_uid] == 1
118120

119121
bob_uid = subtensor.subnets.get_uid_for_hotkey_on_subnet(
120122
hotkey_ss58=bob_wallet.hotkey.ss58_address, netuid=alice_subnet_netuid
121123
)
122-
assert (
123-
subtensor.metagraphs.get_metagraph_info(
124-
alice_subnet_netuid, field_indices=[72]
125-
).validators[bob_uid]
126-
== 0
127-
)
124+
assert validators[bob_uid] == 0
128125

129126
while True:
130127
try:

0 commit comments

Comments
 (0)