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

Test generationm: make nil-count randomization work for lists #1347

Merged
merged 1 commit into from
Aug 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test_libs/pyspec/eth2spec/debug/random_value.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ def get_random_ssz_object(rng: Random,
length = 1
elif mode == RandomizationMode.mode_max_count:
length = max_list_length
elif mode == RandomizationMode.mode_nil_count:
length = 0

if typ.length < length: # SSZ imposes a hard limit on lists, we can't put in more than that
length = typ.length
Expand Down