Skip to content

Commit

Permalink
disable stake comparing, since it is the alpha now
Browse files Browse the repository at this point in the history
  • Loading branch information
open-junius committed Nov 14, 2024
1 parent 676b3b9 commit 6a5c3aa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions tests/e2e_tests/test_dendrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ async def test_dendrite(local_chain):
metagraph = Metagraph(netuid=netuid, network="ws://localhost:9945")
old_neuron = metagraph.neurons[1]

# Assert stake is 10000
assert (
old_neuron.stake.tao == 10_000.0
), f"Expected 10_000.0 staked TAO, but got {neuron.stake.tao}"
# Assert stake is 10000 can't compare anymore. the stake value is the alpha now.
# assert (
# old_neuron.stake.tao == 10_000.0
# ), f"Expected 10_000.0 staked TAO, but got {neuron.stake.tao}"

# Assert neuron is not a validator yet
assert old_neuron.active is True
Expand Down
5 changes: 3 additions & 2 deletions tests/e2e_tests/test_incentive.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ async def test_incentive(local_chain):
alice_neuron = metagraph.neurons[0]
assert alice_neuron.validator_permit is False
assert alice_neuron.dividends == 0
assert alice_neuron.stake.tao == 10_000.0

# assert alice_neuron.stake.tao == 10_000.0
assert alice_neuron.validator_trust == 0

# Wait until next epoch
Expand Down Expand Up @@ -176,7 +177,7 @@ async def test_incentive(local_chain):
alice_neuron = metagraph.neurons[0]
assert alice_neuron.validator_permit is True
assert alice_neuron.dividends == 1
assert alice_neuron.stake.tao == 10_000.0
# assert alice_neuron.stake.tao == 10_000.0
assert alice_neuron.validator_trust == 1

logging.info("✅ Passed test_incentive")
15 changes: 9 additions & 6 deletions tests/e2e_tests/test_metagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@ def test_metagraph(local_chain):

# Assert stake is added after updating metagraph
metagraph.sync(subtensor=subtensor)
assert metagraph.neurons[1].stake == Balance.from_tao(
10_000
), "Bob's stake not updated in metagraph"
# can't compare it now, the stake is alpha
# assert metagraph.neurons[1].stake == Balance.from_tao(
# 10_000
# ), "Bob's stake not updated in metagraph"

# Test the save() and load() mechanism
# We save the metagraph and pre_dave loads it
Expand Down Expand Up @@ -171,8 +172,10 @@ def test_metagraph(local_chain):
assert len(metagraph.neurons) == len(
metagraph_pre_dave.neurons
), "Neuron count mismatch after save and load"
assert (
metagraph.neurons == metagraph_pre_dave.neurons
), "Neurons don't match after save and load"

# can't compare because the same reason, the staked alpha is updating time to time.
# assert (
# metagraph.neurons == metagraph_pre_dave.neurons
# ), "Neurons don't match after save and load"

logging.info("✅ Passed test_metagraph")

0 comments on commit 6a5c3aa

Please sign in to comment.