Merge pull request #398 from wemeetagain/ssz/fix-deserialize-uint
Fix deserialize uint bounds logic
This commit is contained in:
commit
92747579cd
|
@ -248,10 +248,10 @@ size as the integer length. (e.g. ``uint16 == 2 bytes``)
|
||||||
All integers are interpreted as **big endian**.
|
All integers are interpreted as **big endian**.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
assert(len(rawbytes) >= current_index + int_size)
|
|
||||||
byte_length = int_size / 8
|
byte_length = int_size / 8
|
||||||
new_index = current_index + int_size
|
new_index = current_index + byte_length
|
||||||
return int.from_bytes(rawbytes[current_index:current_index+int_size], 'big'), new_index
|
assert(len(rawbytes) >= new_index)
|
||||||
|
return int.from_bytes(rawbytes[current_index:current_index+byte_length], 'big'), new_index
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Bool
|
#### Bool
|
||||||
|
|
Loading…
Reference in New Issue