From deb4dbd9c889f14f5d708410b024d9d75c188f0e Mon Sep 17 00:00:00 2001 From: Dmitrii Shmatko Date: Sat, 25 Sep 2021 01:26:01 +0300 Subject: [PATCH] Make empty pow_block hash generation Python 3.8 compatible --- tests/core/pyspec/eth2spec/test/helpers/fork_choice.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/core/pyspec/eth2spec/test/helpers/fork_choice.py b/tests/core/pyspec/eth2spec/test/helpers/fork_choice.py index 640614288..cc0860bfd 100644 --- a/tests/core/pyspec/eth2spec/test/helpers/fork_choice.py +++ b/tests/core/pyspec/eth2spec/test/helpers/fork_choice.py @@ -241,8 +241,8 @@ def apply_next_slots_with_attestations(spec, def prepare_empty_pow_block(spec, rng=Random(3131)): return spec.PowBlock( - block_hash=spec.Hash32(spec.hash(rng.randbytes(32))), - parent_hash=spec.Hash32(spec.hash(rng.randbytes(32))), + block_hash=spec.Hash32(spec.hash(bytearray(rng.getrandbits(8) for _ in range(32)))), + parent_hash=spec.Hash32(spec.hash(bytearray(rng.getrandbits(8) for _ in range(32)))), total_difficulty=uint256(0), difficulty=uint256(0) )