mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-26 09:15:17 +00:00
fix lint, and update encoder to handle the few imported types well
This commit is contained in:
parent
47034a6c8c
commit
0249cf651e
@ -1,6 +1,6 @@
|
|||||||
from eth2spec.utils.ssz.ssz_impl import hash_tree_root
|
from eth2spec.utils.ssz.ssz_impl import hash_tree_root
|
||||||
from eth2spec.utils.ssz.ssz_typing import (
|
from eth2spec.utils.ssz.ssz_typing import (
|
||||||
SSZValue, uint, Container, Bytes, BytesN, List, Vector, Bit
|
SSZValue, uint, Container, Bit
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -11,8 +11,7 @@ def encode(value: SSZValue, include_hash_tree_roots=False):
|
|||||||
return str(value)
|
return str(value)
|
||||||
return value
|
return value
|
||||||
elif isinstance(value, Bit):
|
elif isinstance(value, Bit):
|
||||||
assert value in (True, False)
|
return value == 1
|
||||||
return value
|
|
||||||
elif isinstance(value, list): # normal python lists, ssz-List, Vector
|
elif isinstance(value, list): # normal python lists, ssz-List, Vector
|
||||||
return [encode(element, include_hash_tree_roots) for element in value]
|
return [encode(element, include_hash_tree_roots) for element in value]
|
||||||
elif isinstance(value, bytes): # both bytes and BytesN
|
elif isinstance(value, bytes): # both bytes and BytesN
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from typing import List
|
|
||||||
|
|
||||||
from eth2spec.utils.ssz.ssz_impl import signing_root
|
from eth2spec.utils.ssz.ssz_impl import signing_root
|
||||||
from eth2spec.utils.bls import bls_sign
|
from eth2spec.utils.bls import bls_sign
|
||||||
|
Loading…
x
Reference in New Issue
Block a user