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:
hopinheimer
2026-05-12 02:24:18 -04:00
committed by GitHub
parent f968c7e5bb
commit 757873200b
13 changed files with 118 additions and 226 deletions

View File

@@ -4,7 +4,6 @@ mod exit;
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
use bls::Keypair;
use fixed_bytes::FixedBytesExtended;
use ssz::Encode;
use std::env;
use std::fs::{self, File};
@@ -13,7 +12,7 @@ use std::path::{Path, PathBuf};
use std::process::exit;
use std::sync::LazyLock;
use types::{BeaconState, EthSpec, SignedBeaconBlock, test_utils::generate_deterministic_keypairs};
use types::{Hash256, MainnetEthSpec, Slot};
use types::{MainnetEthSpec, Slot};
type E = MainnetEthSpec;
@@ -65,7 +64,6 @@ async fn get_harness<E: EthSpec>(
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
(skip_to_slot.as_u64()..slot.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()