-
Notifications
You must be signed in to change notification settings - Fork 418
[e2e] fix: e2e test for metagraph expected not matching #3137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
camfairchild
wants to merge
5
commits into
staging
from
fix/e2e/metagraph-info-expected-not-matching
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -199,7 +199,9 @@ def test_metagraph_info(subtensor, alice_wallet, bob_wallet): | |
| alice_subnet_netuid = subtensor.get_total_subnets() # 2 | ||
| subtensor.register_subnet(alice_wallet, True, True) | ||
|
|
||
| metagraph_info = subtensor.get_metagraph_info(netuid=1, block=1) | ||
| block = 1 | ||
| alpha_per_block = 1 | ||
| metagraph_info = subtensor.get_metagraph_info(netuid=1, block=block) | ||
|
|
||
| expected_metagraph_info = MetagraphInfo( | ||
| netuid=1, | ||
|
|
@@ -209,18 +211,18 @@ def test_metagraph_info(subtensor, alice_wallet, bob_wallet): | |
| network_registered_at=0, | ||
| owner_hotkey="5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM", | ||
| owner_coldkey="5C4hrfjw9DjXZTzV3MwzrrAr9P1MJhSrvWGWqi1eSuyUpnhM", | ||
| block=1, | ||
| block=block, | ||
| tempo=100, | ||
| last_step=0, | ||
| blocks_since_last_step=1, | ||
| subnet_emission=Balance(0), | ||
| alpha_in=Balance.from_tao(10).set_unit(1), | ||
| alpha_out=Balance.from_tao(1).set_unit(1), | ||
| alpha_out=Balance.from_tao((1 + block) * alpha_per_block).set_unit(1), # it's been 2 blocks | ||
|
||
| tao_in=Balance.from_tao(10), | ||
| alpha_out_emission=Balance(0).set_unit(1), | ||
| alpha_out_emission=Balance.from_tao(block * alpha_per_block).set_unit(1), # 1 alpha per block | ||
| alpha_in_emission=Balance(0).set_unit(1), | ||
| tao_in_emission=Balance(0), | ||
| pending_alpha_emission=Balance(0).set_unit(1), | ||
| pending_alpha_emission=Balance.from_tao(0.820_004_577).set_unit(1), # minus owner cut already | ||
| pending_root_emission=Balance(0), | ||
| subnet_volume=Balance(0).set_unit(1), | ||
| moving_price=Balance(0), | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be
block = registration block + 1? Otherwise it's just always using the first block, which is happens before the subnet is even created. But even then we're basically checking a blank slate.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in this part of the test we compare first blocks