mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 01:05:15 +00:00
deserialize-basic detail, make subclass
This commit is contained in:
parent
82ae180490
commit
c73417b4ca
@ -27,7 +27,7 @@ def deserialize_basic(value, typ: BasicType):
|
||||
return typ(int.from_bytes(value, 'little'))
|
||||
elif issubclass(typ, Bit):
|
||||
assert value in (b'\x00', b'\x01')
|
||||
return Bit(value == b'\x01')
|
||||
return typ(value == b'\x01')
|
||||
else:
|
||||
raise Exception(f"Type not supported: {typ}")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user