Update specs/light_client/merkle_proofs.md

Co-Authored-By: Danny Ryan <dannyjryan@gmail.com>
This commit is contained in:
vbuterin 2019-08-01 08:08:18 -04:00 committed by GitHub
parent 92fc0f2b81
commit 446ad3c392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -267,7 +267,7 @@ def extract_value_at_path(chunks: Dict[int, Bytes32], typ: Type, path: List[Unio
for p in path: for p in path:
if p == '__len__': if p == '__len__':
return deserialize_basic(chunks[root * 2 + 1][:8], uint64) return deserialize_basic(chunks[root * 2 + 1][:8], uint64)
if iissubclass(typ, (List, Bytes)): if issubclass(typ, (List, Bytes)):
assert 0 <= p < deserialize_basic(chunks[root * 2 + 1][:8], uint64) assert 0 <= p < deserialize_basic(chunks[root * 2 + 1][:8], uint64)
pos, start, end = get_item_position(typ, p) pos, start, end = get_item_position(typ, p)
root = root * (2 if issubclass(typ, (List, Bytes)) else 1) * next_power_of_two(get_chunk_count(typ)) + pos root = root * (2 if issubclass(typ, (List, Bytes)) else 1) * next_power_of_two(get_chunk_count(typ)) + pos