Merge pull request #398 from wemeetagain/ssz/fix-deserialize-uint

Fix deserialize uint bounds logic
This commit is contained in:
Danny Ryan 2019-01-07 08:13:56 -07:00 committed by GitHub
commit 92747579cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -248,10 +248,10 @@ size as the integer length. (e.g. ``uint16 == 2 bytes``)
All integers are interpreted as **big endian**.
```python
assert(len(rawbytes) >= current_index + int_size)
byte_length = int_size / 8
new_index = current_index + int_size
return int.from_bytes(rawbytes[current_index:current_index+int_size], 'big'), new_index
new_index = current_index + byte_length
assert(len(rawbytes) >= new_index)
return int.from_bytes(rawbytes[current_index:current_index+byte_length], 'big'), new_index
```
#### Bool