mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
Use E for EthSpec globally (#5264)
* Use `E` for `EthSpec` globally * Fix tests * Merge branch 'unstable' into e-ethspec * Merge branch 'unstable' into e-ethspec # Conflicts: # beacon_node/execution_layer/src/engine_api.rs # beacon_node/execution_layer/src/engine_api/http.rs # beacon_node/execution_layer/src/engine_api/json_structures.rs # beacon_node/execution_layer/src/test_utils/handle_rpc.rs # beacon_node/store/src/partial_beacon_state.rs # consensus/types/src/beacon_block.rs # consensus/types/src/beacon_block_body.rs # consensus/types/src/beacon_state.rs # consensus/types/src/config_and_preset.rs # consensus/types/src/execution_payload.rs # consensus/types/src/execution_payload_header.rs # consensus/types/src/light_client_optimistic_update.rs # consensus/types/src/payload.rs # lcli/src/parse_ssz.rs
This commit is contained in:
@@ -101,15 +101,15 @@ impl PartialEq<bool> for RequireSynced {
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error<E> {
|
||||
pub enum Error<T> {
|
||||
/// The node was unavailable and we didn't attempt to contact it.
|
||||
Unavailable(CandidateError),
|
||||
/// We attempted to contact the node but it failed.
|
||||
RequestFailed(E),
|
||||
RequestFailed(T),
|
||||
}
|
||||
|
||||
impl<E> Error<E> {
|
||||
pub fn request_failure(&self) -> Option<&E> {
|
||||
impl<T> Error<T> {
|
||||
pub fn request_failure(&self) -> Option<&T> {
|
||||
match self {
|
||||
Error::RequestFailed(e) => Some(e),
|
||||
_ => None,
|
||||
@@ -118,9 +118,9 @@ impl<E> Error<E> {
|
||||
}
|
||||
|
||||
/// The list of errors encountered whilst attempting to perform a query.
|
||||
pub struct Errors<E>(pub Vec<(String, Error<E>)>);
|
||||
pub struct Errors<T>(pub Vec<(String, Error<T>)>);
|
||||
|
||||
impl<E: Debug> fmt::Display for Errors<E> {
|
||||
impl<T: Debug> fmt::Display for Errors<T> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
if !self.0.is_empty() {
|
||||
write!(f, "Some endpoints failed, num_failed: {}", self.0.len())?;
|
||||
|
||||
Reference in New Issue
Block a user