From ab8b5dfc78feef508d8b475b2633b328ebabc157 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 27 Nov 2019 13:11:44 +1100 Subject: [PATCH] Fix broken tests in eth1 --- beacon_node/beacon_chain/src/eth1_chain.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/beacon_node/beacon_chain/src/eth1_chain.rs b/beacon_node/beacon_chain/src/eth1_chain.rs index aa61b70294..2e3bf87656 100644 --- a/beacon_node/beacon_chain/src/eth1_chain.rs +++ b/beacon_node/beacon_chain/src/eth1_chain.rs @@ -727,6 +727,14 @@ mod test { prev_state.slot = Slot::new(period * 1_000); state.slot = Slot::new(period * 1_000 + period / 2); + // Add 50% of the votes so a lookup is required. + for _ in 0..period / 2 { + state + .eth1_data_votes + .push(random_eth1_data()) + .expect("should push eth1 vote"); + } + (0..2048).for_each(|i| { eth1_chain .backend @@ -798,6 +806,14 @@ mod test { state.slot = Slot::new(period / 2); + // Add 50% of the votes so a lookup is required. + for _ in 0..period / 2 { + state + .eth1_data_votes + .push(random_eth1_data()) + .expect("should push eth1 vote"); + } + let expected_root = Hash256::from_low_u64_be(42); prev_state.eth1_data.block_hash = expected_root;