mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-02 16:21:42 +00:00
Prepare sensitive_url for crates.io (#8223)
Another good candidate for publishing separately from Lighthouse is `sensitive_url` as it's a general utility crate and not related to Ethereum. This PR prepares it to be spun out into its own crate. I've made the `full` field on `SensitiveUrl` private and instead provided an explicit getter called `.expose_full()`. It's a bit ugly for the diff but I prefer the explicit nature of the getter. I've also added some extra tests and doc strings along with feature gating `Serialize` and `Deserialize` implementations behind the `serde` feature. Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
@@ -191,8 +191,7 @@ async fn run<E: EthSpec>(config: ExitConfig) -> Result<(), String> {
|
||||
// Only publish the voluntary exit if the --beacon-node flag is present
|
||||
if let Some(ref beacon_url) = beacon_url {
|
||||
let beacon_node = BeaconNodeHttpClient::new(
|
||||
SensitiveUrl::parse(beacon_url.as_ref())
|
||||
.map_err(|e| format!("Failed to parse beacon http server: {:?}", e))?,
|
||||
beacon_url.clone(),
|
||||
Timeouts::set_all(Duration::from_secs(12)),
|
||||
);
|
||||
|
||||
@@ -399,7 +398,7 @@ mod test {
|
||||
})
|
||||
.collect();
|
||||
|
||||
let beacon_url = SensitiveUrl::parse(self.beacon_node.client.as_ref()).unwrap();
|
||||
let beacon_url = self.beacon_node.client.server().clone();
|
||||
|
||||
let validators_to_exit = index_of_validators_to_exit
|
||||
.iter()
|
||||
|
||||
@@ -134,8 +134,7 @@ async fn run<E: EthSpec>(config: ListConfig) -> Result<Vec<SingleKeystoreRespons
|
||||
if let Some(ref beacon_url) = beacon_url {
|
||||
for validator in &validators_to_display {
|
||||
let beacon_node = BeaconNodeHttpClient::new(
|
||||
SensitiveUrl::parse(beacon_url.as_ref())
|
||||
.map_err(|e| format!("Failed to parse beacon http server: {:?}", e))?,
|
||||
beacon_url.clone(),
|
||||
Timeouts::set_all(Duration::from_secs(12)),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user