Skip to content

Commit

Permalink
Merge pull request #1347 from ethereum/nil-count
Browse files Browse the repository at this point in the history
Test generationm: make nil-count randomization work for lists
  • Loading branch information
djrtwo authored Aug 12, 2019
2 parents 3b2b688 + bc5811f commit 54a85ce
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit 54a85ce

Please sign in to comment.