mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
Fix state_processing under new BeaconStateTypes
This commit is contained in:
@@ -8,9 +8,10 @@ use types::*;
|
||||
fn runs_without_error() {
|
||||
Builder::from_env(Env::default().default_filter_or("error")).init();
|
||||
|
||||
let spec = ChainSpec::few_validators();
|
||||
let spec = FewValidatorsStateTypes::spec();
|
||||
|
||||
let mut builder = TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
|
||||
let mut builder: TestingBeaconStateBuilder<FewValidatorsStateTypes> =
|
||||
TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
|
||||
|
||||
let target_slot = (spec.genesis_epoch + 4).end_slot(spec.slots_per_epoch);
|
||||
builder.teleport_to_slot(target_slot, &spec);
|
||||
|
||||
@@ -246,7 +246,7 @@ impl ValidatorStatuses {
|
||||
status.is_previous_epoch_boundary_attester = true;
|
||||
}
|
||||
|
||||
if has_common_beacon_block_root(a, state, spec)? {
|
||||
if has_common_beacon_block_root(a, state)? {
|
||||
self.total_balances.previous_epoch_head_attesters += attesting_balance;
|
||||
status.is_previous_epoch_head_attester = true;
|
||||
}
|
||||
@@ -335,7 +335,6 @@ fn has_common_epoch_boundary_root<T: BeaconStateTypes>(
|
||||
fn has_common_beacon_block_root<T: BeaconStateTypes>(
|
||||
a: &PendingAttestation,
|
||||
state: &BeaconState<T>,
|
||||
spec: &ChainSpec,
|
||||
) -> Result<bool, BeaconStateError> {
|
||||
let state_block_root = *state.get_block_root(a.data.slot)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user