mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 20:22:02 +00:00
Misc. dependency cleanup (#6810)
* remove ensure_dir_exists (2 deps saved) * group UNHANDLED_ERRORs into a generic (2 deps saved) * Introduce separate `health_metrics` crate * separate health_metrics crate * remove metrics from warp_utils * move ProcessHealth::observe and SystemHealth::observe to health_metrics * fix errors * nitpick `Cargo.toml`s --------- Co-authored-by: Daniel Knopik <daniel@dknopik.de> # Conflicts: # Cargo.toml
This commit is contained in:
@@ -5,7 +5,7 @@ use eth2::types::{Epoch, ValidatorStatus};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::sync::Arc;
|
||||
use warp_utils::reject::beacon_chain_error;
|
||||
use warp_utils::reject::unhandled_error;
|
||||
|
||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidatorCountResponse {
|
||||
@@ -58,7 +58,7 @@ pub fn get_validator_count<T: BeaconChainTypes>(
|
||||
}
|
||||
Ok::<(), BeaconChainError>(())
|
||||
})
|
||||
.map_err(beacon_chain_error)?;
|
||||
.map_err(unhandled_error)?;
|
||||
|
||||
Ok(ValidatorCountResponse {
|
||||
active_ongoing,
|
||||
@@ -101,7 +101,7 @@ pub fn get_validator_info<T: BeaconChainTypes>(
|
||||
request_data: ValidatorInfoRequestData,
|
||||
chain: Arc<BeaconChain<T>>,
|
||||
) -> Result<ValidatorInfoResponse, warp::Rejection> {
|
||||
let current_epoch = chain.epoch().map_err(beacon_chain_error)?;
|
||||
let current_epoch = chain.epoch().map_err(unhandled_error)?;
|
||||
|
||||
let epochs = current_epoch.saturating_sub(HISTORIC_EPOCHS).as_u64()..=current_epoch.as_u64();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user