Add even more

This commit is contained in:
Mac L
2024-05-02 18:07:56 +10:00
parent d9a0c3d6c2
commit 5a4be377d4
18 changed files with 251 additions and 334 deletions

View File

@@ -30,7 +30,7 @@ use store::consts::altair::{
TIMELY_TARGET_FLAG_INDEX,
};
use types::consts::altair::WEIGHT_DENOMINATOR;
use types::{BeaconState, Epoch, EthSpec, RelativeEpoch};
use types::{BeaconState, Epoch, EthSpec, FeatureName, RelativeEpoch};
impl<T: BeaconChainTypes> BeaconChain<T> {
pub fn compute_attestation_rewards(
@@ -51,13 +51,10 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
.get_state(&state_root, Some(state_slot))?
.ok_or(BeaconChainError::MissingBeaconState(state_root))?;
match state {
BeaconState::Base(_) => self.compute_attestation_rewards_base(state, validators),
BeaconState::Altair(_)
| BeaconState::Bellatrix(_)
| BeaconState::Capella(_)
| BeaconState::Deneb(_)
| BeaconState::Electra(_) => self.compute_attestation_rewards_altair(state, validators),
if state.has_feature(FeatureName::Altair) {
self.compute_attestation_rewards_altair(state, validators)
} else {
self.compute_attestation_rewards_base(state, validators)
}
}