move decoder for fuzzing, minor fixes, update dependency to support SOS style offsets
This commit is contained in:
parent
e7bb9bf19b
commit
7b0ffc1ace
|
@ -1,3 +0,0 @@
|
|||
../../test_libs/pyspec
|
||||
../../test_libs/config_helpers
|
||||
ssz==0.1.0a8
|
|
@ -10,7 +10,7 @@ def translate_typ(typ) -> ssz.BaseSedes:
|
|||
"""
|
||||
if spec_ssz.is_container_type(typ):
|
||||
return ssz.Container(
|
||||
[(field_name, translate_typ(field_typ)) for (field_name, field_typ) in typ.get_fields()])
|
||||
[translate_typ(field_typ) for (field_name, field_typ) in typ.get_fields()])
|
||||
elif spec_ssz.is_bytesn_type(typ):
|
||||
return ssz.ByteVector(typ.length)
|
||||
elif spec_ssz.is_bytes_type(typ):
|
||||
|
@ -38,7 +38,7 @@ def translate_typ(typ) -> ssz.BaseSedes:
|
|||
else:
|
||||
raise TypeError("invalid uint size")
|
||||
else:
|
||||
raise Exception("Type not supported: {}".format(typ))
|
||||
raise TypeError("Type not supported: {}".format(typ))
|
||||
|
||||
|
||||
def translate_value(value, typ):
|
||||
|
@ -79,6 +79,6 @@ def translate_value(value, typ):
|
|||
return value
|
||||
elif spec_ssz.is_container_type(typ):
|
||||
return typ(**{f_name: translate_value(f_val, f_typ) for (f_name, f_val, f_typ)
|
||||
in zip(typ.get_field_names(), value.values(), typ.get_field_types())})
|
||||
in zip(typ.get_field_names(), value, typ.get_field_types())})
|
||||
else:
|
||||
raise Exception("Type not supported: {}".format(typ))
|
||||
raise TypeError("Type not supported: {}".format(typ))
|
|
@ -3,3 +3,4 @@ eth-typing>=2.1.0,<3.0.0
|
|||
pycryptodome==3.7.3
|
||||
py_ecc>=1.6.0
|
||||
typing_inspect==0.4.0
|
||||
ssz==0.1.0a9
|
||||
|
|
|
@ -9,6 +9,7 @@ setup(
|
|||
"eth-typing>=2.1.0,<3.0.0",
|
||||
"pycryptodome==3.7.3",
|
||||
"py_ecc>=1.6.0",
|
||||
"typing_inspect==0.4.0"
|
||||
"typing_inspect==0.4.0",
|
||||
"ssz==0.1.0a9"
|
||||
]
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue