Satisfy Clippy, remove non-tree-states code

This commit is contained in:
Michael Sproul
2022-03-28 11:42:55 +11:00
parent 705cba6443
commit c5212d0f98
45 changed files with 129 additions and 1153 deletions

View File

@@ -7,9 +7,7 @@ use beacon_chain::{
use eth2::types::{self as api_types};
use slot_clock::SlotClock;
use state_processing::state_advance::partial_state_advance;
use types::{
AttestationDuty, BeaconState, ChainSpec, CloneConfig, Epoch, EthSpec, Hash256, RelativeEpoch,
};
use types::{AttestationDuty, BeaconState, ChainSpec, Epoch, EthSpec, Hash256, RelativeEpoch};
/// The struct that is returned to the requesting HTTP client.
type ApiDuties = api_types::DutiesResponse<Vec<api_types::AttesterData>>;
@@ -82,11 +80,7 @@ fn compute_historic_attester_duties<T: BeaconChainTypes>(
let state_opt = chain
.with_head(|head| {
if head.beacon_state.current_epoch() <= request_epoch {
Ok(Some((
head.beacon_state_root(),
head.beacon_state
.clone_with(CloneConfig::committee_caches_only()),
)))
Ok(Some((head.beacon_state_root(), head.beacon_state.clone())))
} else {
Ok(None)
}

View File

@@ -10,7 +10,7 @@ use safe_arith::SafeArith;
use slog::{debug, Logger};
use slot_clock::SlotClock;
use std::cmp::Ordering;
use types::{CloneConfig, Epoch, EthSpec, Hash256, Slot};
use types::{Epoch, EthSpec, Hash256, Slot};
/// The struct that is returned to the requesting HTTP client.
type ApiDuties = api_types::DutiesResponse<Vec<api_types::ProposerData>>;
@@ -158,11 +158,7 @@ fn compute_historic_proposer_duties<T: BeaconChainTypes>(
let state_opt = chain
.with_head(|head| {
if head.beacon_state.current_epoch() <= epoch {
Ok(Some((
head.beacon_state_root(),
head.beacon_state
.clone_with(CloneConfig::committee_caches_only()),
)))
Ok(Some((head.beacon_state_root(), head.beacon_state.clone())))
} else {
Ok(None)
}