mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-07 16:55:46 +00:00
Add support for beaconAPI in lcli functions (#3252)
## Issue Addressed NA ## Proposed Changes Modifies `lcli skip-slots` and `lcli transition-blocks` allow them to source blocks/states from a beaconAPI and also gives them some more features to assist with benchmarking. ## Additional Info Breaks the current `lcli skip-slots` and `lcli transition-blocks` APIs by changing some flag names. It should be simple enough to figure out the changes via `--help`. Currently blocked on #3263.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||
use std::fmt;
|
||||
use std::str::FromStr;
|
||||
use url::Url;
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -9,6 +10,12 @@ pub enum SensitiveError {
|
||||
RedactError(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for SensitiveError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(f, "{:?}", self)
|
||||
}
|
||||
}
|
||||
|
||||
// Wrapper around Url which provides a custom `Display` implementation to protect user secrets.
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub struct SensitiveUrl {
|
||||
@@ -54,6 +61,14 @@ impl<'de> Deserialize<'de> for SensitiveUrl {
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for SensitiveUrl {
|
||||
type Err = SensitiveError;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
Self::parse(s)
|
||||
}
|
||||
}
|
||||
|
||||
impl SensitiveUrl {
|
||||
pub fn parse(url: &str) -> Result<Self, SensitiveError> {
|
||||
let surl = Url::parse(url).map_err(SensitiveError::ParseError)?;
|
||||
|
||||
Reference in New Issue
Block a user