Skip to content

Commit

Permalink
Add BaseList to cover Bytes and BytesN
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Aug 20, 2019
1 parent 6577f15 commit a1061f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/build_spec.py
Expand Up @@ -54,7 +54,7 @@
is_zero,
)
from eth2spec.utils.ssz.ssz_typing import (
BasicValue, Elements, BaseList, SSZType,
BasicValue, Elements, BaseBytes, BaseList, SSZType,
Container, List, Vector, Bytes, BytesN, Bitlist, Bitvector, Bits,
Bytes1, Bytes4, Bytes8, Bytes32, Bytes48, Bytes96,
uint64, bit, boolean,
Expand Down
3 changes: 2 additions & 1 deletion specs/light_client/merkle_proofs.md
Expand Up @@ -106,7 +106,8 @@ def item_length(typ: SSZType) -> int:
```

```python
def get_elem_type(typ: Union[BaseList, Container], index_or_variable_name: Union[int, SSZVariableName]) -> SSZType:
def get_elem_type(typ: Union[BaseBytes, BaseList, Container],
index_or_variable_name: Union[int, SSZVariableName]) -> SSZType:
"""
Return the type of the element of an object of the given type with the given index
or member variable name (eg. `7` for `x[7]`, `"foo"` for `x.foo`)
Expand Down

0 comments on commit a1061f0

Please sign in to comment.