mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
More variable-variable lists
This commit is contained in:
@@ -21,9 +21,6 @@ use types::{
|
||||
BeaconState, BeaconStateError, ChainSpec, Epoch, EthSpec, ParticipationFlags, RelativeEpoch,
|
||||
};
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse::prelude::*;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum Error {
|
||||
InvalidFlagIndex(usize),
|
||||
|
||||
@@ -6,9 +6,6 @@ use types::eth_spec::EthSpec;
|
||||
use types::participation_flags::ParticipationFlags;
|
||||
use types::VariableList;
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse::prelude::*;
|
||||
|
||||
pub fn process_participation_flag_updates<T: EthSpec>(
|
||||
state: &mut BeaconState<T>,
|
||||
) -> Result<(), EpochProcessingError> {
|
||||
|
||||
@@ -6,9 +6,6 @@ use types::consts::altair::{
|
||||
};
|
||||
use types::{BeaconState, ChainSpec, EthSpec};
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse::prelude::*;
|
||||
|
||||
use crate::common::{altair::get_base_reward, decrease_balance, increase_balance};
|
||||
use crate::per_epoch_processing::{Delta, Error};
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@ use safe_arith::SafeArith;
|
||||
use std::array::IntoIter as ArrayIter;
|
||||
use types::{BeaconState, ChainSpec, EthSpec};
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse::prelude::*;
|
||||
|
||||
/// Combination of several deltas for different components of an attestation reward.
|
||||
///
|
||||
/// Exists only for compatibility with EF rewards tests.
|
||||
|
||||
@@ -2,9 +2,6 @@ use crate::common::get_attesting_indices;
|
||||
use safe_arith::SafeArith;
|
||||
use types::{BeaconState, BeaconStateError, ChainSpec, Epoch, EthSpec, PendingAttestation};
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse::prelude::*;
|
||||
|
||||
#[cfg(feature = "arbitrary-fuzz")]
|
||||
use arbitrary::Arbitrary;
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
use crate::per_epoch_processing::altair::participation_cache::Error as ParticipationCacheError;
|
||||
use types::{BeaconStateError, InconsistentFork};
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
use types::milhouse;
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum EpochProcessingError {
|
||||
UnableToDetermineProducer,
|
||||
@@ -25,6 +28,8 @@ pub enum EpochProcessingError {
|
||||
InvalidJustificationBit(ssz_types::Error),
|
||||
InvalidFlagIndex(usize),
|
||||
ParticipationCache(ParticipationCacheError),
|
||||
#[cfg(feature = "milhouse")]
|
||||
MilhouseError(milhouse::Error),
|
||||
}
|
||||
|
||||
impl From<InclusionError> for EpochProcessingError {
|
||||
@@ -57,6 +62,13 @@ impl From<ParticipationCacheError> for EpochProcessingError {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "milhouse")]
|
||||
impl From<milhouse::Error> for EpochProcessingError {
|
||||
fn from(e: milhouse::Error) -> Self {
|
||||
Self::MilhouseError(e)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub enum InclusionError {
|
||||
/// The validator did not participate in an attestation in this period.
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
use super::errors::EpochProcessingError;
|
||||
use core::result::Result;
|
||||
use core::result::Result::Ok;
|
||||
use safe_arith::SafeArith;
|
||||
use types::beacon_state::BeaconState;
|
||||
use types::eth_spec::EthSpec;
|
||||
use types::{Unsigned, VariableList};
|
||||
use types::{Unsigned, VList};
|
||||
|
||||
pub fn process_eth1_data_reset<T: EthSpec>(
|
||||
state: &mut BeaconState<T>,
|
||||
@@ -15,7 +13,7 @@ pub fn process_eth1_data_reset<T: EthSpec>(
|
||||
.safe_rem(T::SlotsPerEth1VotingPeriod::to_u64())?
|
||||
== 0
|
||||
{
|
||||
*state.eth1_data_votes_mut() = VariableList::empty();
|
||||
*state.eth1_data_votes_mut() = VList::empty();
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user