Skip to content

Commit

Permalink
chore: non-lazy strings
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Nov 14, 2023
1 parent 1f01a71 commit 8195f58
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
36 changes: 18 additions & 18 deletions crates/mevboost-relay-api/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,25 @@ lazy_static! {
m.insert("bloxroute-regulated", "https://0xb0b07cd0abef743db4260b0ed50619cf6ad4d82064cb4fbec9d3ec530f7c5e6793d9f286c4e082c0244ffb9f2658fe88@bloxroute.regulated.blxrbdn.com");
m
};
}

/// Relay endpoint for getting a list of validator registrations
/// for validators scheduled to propose in the current and next epoch.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Builder/getValidators) for more info.
pub static ref GET_VALIDATORS_ENDPOINT: &'static str = "/relay/v1/builder/validators";
/// Relay endpoint for getting a list of validator registrations
/// for validators scheduled to propose in the current and next epoch.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Builder/getValidators) for more info.
pub static GET_VALIDATORS_ENDPOINT: &str = "/relay/v1/builder/validators";

/// Relay endpoint for checking that a validator is registered with a relay.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getValidatorRegistration) for more info.
pub static ref CHECK_VALIDATOR_REGISTRATION: &'static str = "/relay/v1/data/validator_registration";
/// Relay endpoint for checking that a validator is registered with a relay.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getValidatorRegistration) for more info.
pub static CHECK_VALIDATOR_REGISTRATION: &str = "/relay/v1/data/validator_registration";

/// Relay endpoint for getting the payloads that were delivered to proposers.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getDeliveredPayloads) for more info.
pub static ref GET_DELIVERED_PAYLOADS: &'static str = "/relay/v1/data/bidtraces/proposer_payload_delivered";
/// Relay endpoint for getting the payloads that were delivered to proposers.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getDeliveredPayloads) for more info.
pub static GET_DELIVERED_PAYLOADS: &str = "/relay/v1/data/bidtraces/proposer_payload_delivered";

/// Relay endpoint for getting the block submission bids delivered to the relay.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getReceivedBids) for more info.
pub static ref GET_BUILDER_BLOCKS_RECEIVED: &'static str = "/relay/v1/data/bidtraces/builder_blocks_received";
}
/// Relay endpoint for getting the block submission bids delivered to the relay.
///
/// [Visit the docs](https://flashbots.github.io/relay-specs/#/Data/getReceivedBids) for more info.
pub static GET_BUILDER_BLOCKS_RECEIVED: &str = "/relay/v1/data/bidtraces/builder_blocks_received";
8 changes: 4 additions & 4 deletions crates/mevboost-relay-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<'a> Client<'a> {
relay_name: &str,
) -> anyhow::Result<Vec<types::RegisteredValidator>> {
let relay_url = self.get_relay_url(relay_name)?;
let endpoint = format!("{}{}", relay_url, *constants::GET_VALIDATORS_ENDPOINT);
let endpoint = format!("{}{}", relay_url, constants::GET_VALIDATORS_ENDPOINT);
let response = self.fetch(endpoint).await?;

serde_json::from_str::<Vec<types::RegisteredValidator>>(&response)
Expand All @@ -78,7 +78,7 @@ impl<'a> Client<'a> {
let endpoint = format!(
"{}{}?pubkey={}",
relay_url,
*constants::CHECK_VALIDATOR_REGISTRATION,
constants::CHECK_VALIDATOR_REGISTRATION,
pubkey
);
let response = self.fetch(endpoint).await?;
Expand All @@ -98,7 +98,7 @@ impl<'a> Client<'a> {
let endpoint = format!(
"{}{}{}",
relay_url,
*constants::GET_DELIVERED_PAYLOADS,
constants::GET_DELIVERED_PAYLOADS,
opts.to_string()
);
let response = self.fetch(endpoint).await?;
Expand All @@ -118,7 +118,7 @@ impl<'a> Client<'a> {
let endpoint = format!(
"{}{}{}",
relay_url,
*constants::GET_BUILDER_BLOCKS_RECEIVED,
constants::GET_BUILDER_BLOCKS_RECEIVED,
opts.to_string()
);
let response = self.fetch(endpoint).await?;
Expand Down

0 comments on commit 8195f58

Please sign in to comment.