mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-01-13 04:04:19 +00:00
Merge pull request #1175 from ethereum/bytes-type-error
fix #1169 bytes type error
This commit is contained in:
commit
e4704e08cc
@ -32,6 +32,7 @@ def test_empty_block_transition(spec, state):
|
||||
|
||||
assert len(state.eth1_data_votes) == pre_eth1_votes + 1
|
||||
assert spec.get_block_root_at_slot(state, pre_slot) == block.parent_root
|
||||
assert spec.get_randao_mix(state, spec.get_current_epoch(state)) != spec.ZERO_HASH
|
||||
|
||||
|
||||
@with_all_phases
|
||||
@ -49,6 +50,7 @@ def test_skipped_slots(spec, state):
|
||||
yield 'post', state
|
||||
|
||||
assert state.slot == block.slot
|
||||
assert spec.get_randao_mix(state, spec.get_current_epoch(state)) != spec.ZERO_HASH
|
||||
for slot in range(pre_slot, state.slot):
|
||||
assert spec.get_block_root_at_slot(state, slot) == block.parent_root
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
from types import GeneratorType
|
||||
from typing import List, Iterable, TypeVar, Type, NewType
|
||||
from typing import Union
|
||||
from typing_inspect import get_origin
|
||||
@ -356,6 +357,8 @@ def parse_bytes(val):
|
||||
return val
|
||||
elif isinstance(val, int):
|
||||
return bytes([val])
|
||||
elif isinstance(val, (list, GeneratorType)):
|
||||
return bytes(val)
|
||||
else:
|
||||
return None
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user