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

@@ -12,7 +12,6 @@ use crate::{
};
use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType};
use bls::{AggregateSignature, Keypair, PublicKeyBytes, Signature, SignatureBytes};
use fixed_bytes::FixedBytesExtended;
use ssz_types::Bitfield;
use ssz_types::VariableList;
use std::sync::{Arc, LazyLock};
@@ -52,7 +51,6 @@ async fn get_harness<E: EthSpec>(
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
(1..last_slot_of_epoch.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -2,7 +2,6 @@
use crate::per_epoch_processing::process_epoch;
use beacon_chain::test_utils::BeaconChainHarness;
use beacon_chain::types::{EthSpec, MinimalEthSpec};
use bls::{FixedBytesExtended, Hash256};
use types::Slot;
#[tokio::test]
@@ -22,7 +21,6 @@ async fn runs_without_error() {
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
(1..target_slot.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -47,7 +47,6 @@ async fn new_state<E: EthSpec>(validator_count: usize, slot: Slot) -> BeaconStat
harness
.add_attested_blocks_at_slots(
head_state,
Hash256::zero(),
(1..=slot.as_u64())
.map(Slot::new)
.collect::<Vec<_>>()

View File

@@ -39,7 +39,6 @@ async fn get_harness<E: EthSpec>(
harness
.add_attested_blocks_at_slots(
state,
Hash256::zero(),
slots.as_slice(),
(0..validator_count).collect::<Vec<_>>().as_slice(),
)