mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +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:
@@ -270,7 +270,7 @@ impl BuilderHttpClient {
|
||||
&self,
|
||||
validator: &[SignedValidatorRegistrationData],
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
@@ -289,7 +289,7 @@ impl BuilderHttpClient {
|
||||
&self,
|
||||
blinded_block: &SignedBlindedBeaconBlock<E>,
|
||||
) -> Result<FullPayloadContents<E>, Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
let body = blinded_block.as_ssz_bytes();
|
||||
|
||||
@@ -337,7 +337,7 @@ impl BuilderHttpClient {
|
||||
&self,
|
||||
blinded_block: &SignedBlindedBeaconBlock<E>,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
let body = blinded_block.as_ssz_bytes();
|
||||
|
||||
@@ -387,7 +387,7 @@ impl BuilderHttpClient {
|
||||
&self,
|
||||
blinded_block: &SignedBlindedBeaconBlock<E>,
|
||||
) -> Result<ForkVersionedResponse<FullPayloadContents<E>>, Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
@@ -430,7 +430,7 @@ impl BuilderHttpClient {
|
||||
&self,
|
||||
blinded_block: &SignedBlindedBeaconBlock<E>,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
@@ -480,7 +480,7 @@ impl BuilderHttpClient {
|
||||
parent_hash: ExecutionBlockHash,
|
||||
pubkey: &PublicKeyBytes,
|
||||
) -> Result<Option<ForkVersionedResponse<SignedBuilderBid<E>>>, Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
@@ -521,7 +521,7 @@ impl BuilderHttpClient {
|
||||
|
||||
/// `GET /eth/v1/builder/status`
|
||||
pub async fn get_builder_status<E: EthSpec>(&self) -> Result<(), Error> {
|
||||
let mut path = self.server.full.clone();
|
||||
let mut path = self.server.expose_full().clone();
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
|
||||
Reference in New Issue
Block a user