From 7baf81e4c2991d31982bf252562d4cfe3d7428e9 Mon Sep 17 00:00:00 2001 From: protolambda Date: Thu, 5 Dec 2019 18:47:41 +0100 Subject: [PATCH] minor test style change, avoid state copy --- .../pyspec/eth2spec/test/fork_choice/test_get_head.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test_libs/pyspec/eth2spec/test/fork_choice/test_get_head.py b/test_libs/pyspec/eth2spec/test/fork_choice/test_get_head.py index f0098bb98..c40864c81 100644 --- a/test_libs/pyspec/eth2spec/test/fork_choice/test_get_head.py +++ b/test_libs/pyspec/eth2spec/test/fork_choice/test_get_head.py @@ -122,15 +122,15 @@ def test_shorter_chain_but_heavier_weight(spec, state): @with_all_phases @spec_state_test def test_filtered_block_tree(spec, state): - genesis_state = state.copy() + # Initialization + genesis_state_root = state.hash_tree_root() + store = spec.get_genesis_store(state) + genesis_block = spec.BeaconBlock(state_root=genesis_state_root) # transition state past initial couple of epochs next_epoch(spec, state) next_epoch(spec, state) - # Initialization - store = spec.get_genesis_store(genesis_state) - genesis_block = spec.BeaconBlock(state_root=genesis_state.hash_tree_root()) assert spec.get_head(store) == spec.signing_root(genesis_block) # fill in attestations for entire epoch, justifying the recent epoch