mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Fix stale beacon_state_root in test helpers (#9289)
Test helpers `add_attested_block_at_slot` and `add_attested_blocks_at_slot` accepted `state_root` argument which was computed before applying the block. Co-Authored-By: hopinheimer <knmanas6@gmail.com>
This commit is contained in:
@@ -46,8 +46,7 @@ async fn missed_blocks_across_epochs() {
|
||||
|
||||
let harness = get_harness(VALIDATOR_COUNT, vec![]);
|
||||
let validator_monitor = &harness.chain.validator_monitor;
|
||||
let mut genesis_state = harness.get_current_state();
|
||||
let genesis_state_root = genesis_state.update_tree_hash_cache().unwrap();
|
||||
let genesis_state = harness.get_current_state();
|
||||
let genesis_block_root = harness.head_block_root();
|
||||
|
||||
// Skip a slot in the first epoch (to prime the cache inside the missed block function) and then
|
||||
@@ -64,7 +63,7 @@ async fn missed_blocks_across_epochs() {
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
let (block_roots_by_slot, state_roots_by_slot, _, head_state) = harness
|
||||
.add_attested_blocks_at_slots(genesis_state, genesis_state_root, &slots, &all_validators)
|
||||
.add_attested_blocks_at_slots(genesis_state, &slots, &all_validators)
|
||||
.await;
|
||||
|
||||
// Prime the proposer shuffling cache.
|
||||
|
||||
Reference in New Issue
Block a user