updated the issue: 2020, June 18th
What was wrong?
As ethereum/consensus-specs#1863 pointed out, it seems
|
if max_length < 1: |
|
raise ValueError( |
|
f"(Maximum) length of homogenous composites must be at least 1, got {max_length}" |
|
) |
is only for Vector, and then override it in List. It made the illegal condition unclear.
How can it be fixed?
1. Use illegal condition max_length < 0 for HomogeneousProperCompositeSedes (wow it's so long)
2. Override vector types' (Vector and Bitvector) __init__() with illegal condition max_length < 1.
- Remove
HomogeneousProperCompositeSedes.__init_()
- Update vector types' (
Vector and Bitvector) __init__() with illegal condition max_length < 1.
- Add list types' (
List and Bitlist) __init__() with illegal condition max_length < 0.
updated the issue: 2020, June 18th
What was wrong?
As ethereum/consensus-specs#1863 pointed out, it seems
py-ssz/ssz/sedes/basic.py
Lines 177 to 180 in 7e9c107
is only for
Vector, and then override it inList. It made the illegal condition unclear.How can it be fixed?
1. Use illegal conditionmax_length < 0forHomogeneousProperCompositeSedes(wow it's so long)2. Override vector types' (VectorandBitvector)__init__()with illegal conditionmax_length < 1.HomogeneousProperCompositeSedes.__init_()VectorandBitvector)__init__()with illegal conditionmax_length < 1.ListandBitlist)__init__()with illegal conditionmax_length < 0.