make nil-count randomization work for lists

This commit is contained in:
protolambda 2019-08-07 13:33:41 +02:00
parent 520c872d21
commit 4f462bc88b
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 2 additions and 0 deletions

View File

@ -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