Skip to content
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

Add more tests for shard_state_transition #1938

Merged
merged 2 commits into from
Jun 29, 2020
Merged

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented Jun 25, 2020

#1928 Part 2

Add more test cases:

  • Invalid cases:

    • test_out_of_bound_offset: the shard block slot is greater than beacon_state.shard_states[shard].slot + spec.SHARD_BLOCK_OFFSETS[spec.MAX_SHARD_BLOCKS_PER_ATTESTATION - 1].
    • test_invalid_offset: the shard block slot is not at the acceptable offsets
    • test_empty_block_body: the shard block body is b''
  • Valid cases:

    • test_max_offset: the shard block slot is equal to beacon_state.shard_states[shard].slot + spec.SHARD_BLOCK_OFFSETS[spec.MAX_SHARD_BLOCKS_PER_ATTESTATION - 1].
    • test_pending_shard_parent_block: the shard block's parent is not included in the beacon state yet.

@hwwhww hwwhww marked this pull request as ready for review June 25, 2020 18:12
@hwwhww hwwhww changed the base branch from hwwhww/shard-block-tests to dev June 26, 2020 03:55
Copy link
Contributor

@djrtwo djrtwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!
one minor suggestion for a sanity check assert

Co-authored-by: Danny Ryan <dannyjryan@gmail.com>
@hwwhww hwwhww merged commit a681163 into dev Jun 29, 2020
@hwwhww hwwhww deleted the hwwhww/shard-block-tests-part2 branch July 2, 2020 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants