Update gloas api routes to match updated spec (#9418)

tldr the routes got pluralized
https://github.com/ethereum/beacon-APIs/pull/613


  


Co-Authored-By: Eitan Seri-Levi <eserilev@ucsc.edu>
This commit is contained in:
Eitan Seri-Levi
2026-06-05 13:16:06 -07:00
committed by GitHub
parent e78e1d38ba
commit 42e678189c
9 changed files with 88 additions and 88 deletions

View File

@@ -2755,8 +2755,8 @@ impl BeaconNodeHttpClient {
opt_response.ok_or(Error::StatusCode(StatusCode::NOT_FOUND))
}
/// `GET v1/validator/execution_payload_envelope/{slot}`
pub async fn get_validator_execution_payload_envelope<E: EthSpec>(
/// `GET v1/validator/execution_payload_envelopes/{slot}`
pub async fn get_validator_execution_payload_envelopes<E: EthSpec>(
&self,
slot: Slot,
) -> Result<ForkVersionedResponse<ExecutionPayloadEnvelope<E>>, Error> {
@@ -2765,14 +2765,14 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("validator")
.push("execution_payload_envelope")
.push("execution_payload_envelopes")
.push(&slot.to_string());
self.get(path).await
}
/// `GET v1/validator/execution_payload_envelope/{slot}` in SSZ format
pub async fn get_validator_execution_payload_envelope_ssz<E: EthSpec>(
/// `GET v1/validator/execution_payload_envelopes/{slot}` in SSZ format
pub async fn get_validator_execution_payload_envelopes_ssz<E: EthSpec>(
&self,
slot: Slot,
) -> Result<ExecutionPayloadEnvelope<E>, Error> {
@@ -2781,7 +2781,7 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("validator")
.push("execution_payload_envelope")
.push("execution_payload_envelopes")
.push(&slot.to_string());
let opt_response = self
@@ -2793,8 +2793,8 @@ impl BeaconNodeHttpClient {
ExecutionPayloadEnvelope::from_ssz_bytes(&response_bytes).map_err(Error::InvalidSsz)
}
/// `POST v1/beacon/execution_payload_envelope`
pub async fn post_beacon_execution_payload_envelope<E: EthSpec>(
/// `POST v1/beacon/execution_payload_envelopes`
pub async fn post_beacon_execution_payload_envelopes<E: EthSpec>(
&self,
envelope: &SignedExecutionPayloadEnvelope<E>,
fork_name: ForkName,
@@ -2804,7 +2804,7 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("execution_payload_envelope");
.push("execution_payload_envelopes");
self.post_generic_with_consensus_version(
path,
@@ -2817,8 +2817,8 @@ impl BeaconNodeHttpClient {
Ok(())
}
/// `POST v1/beacon/execution_payload_envelope` in SSZ format
pub async fn post_beacon_execution_payload_envelope_ssz<E: EthSpec>(
/// `POST v1/beacon/execution_payload_envelopes` in SSZ format
pub async fn post_beacon_execution_payload_envelopes_ssz<E: EthSpec>(
&self,
envelope: &SignedExecutionPayloadEnvelope<E>,
fork_name: ForkName,
@@ -2828,7 +2828,7 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("execution_payload_envelope");
.push("execution_payload_envelopes");
self.post_generic_with_consensus_version_and_ssz_body(
path,
@@ -2841,8 +2841,8 @@ impl BeaconNodeHttpClient {
Ok(())
}
/// `POST v1/beacon/execution_payload_bid`
pub async fn post_beacon_execution_payload_bid<E: EthSpec>(
/// `POST v1/beacon/execution_payload_bids`
pub async fn post_beacon_execution_payload_bids<E: EthSpec>(
&self,
bid: &SignedExecutionPayloadBid<E>,
fork_name: ForkName,
@@ -2852,7 +2852,7 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("execution_payload_bid");
.push("execution_payload_bids");
self.post_generic_with_consensus_version(
path,
@@ -2865,8 +2865,8 @@ impl BeaconNodeHttpClient {
Ok(())
}
/// `POST v1/beacon/execution_payload_bid` in SSZ format
pub async fn post_beacon_execution_payload_bid_ssz<E: EthSpec>(
/// `POST v1/beacon/execution_payload_bids` in SSZ format
pub async fn post_beacon_execution_payload_bids_ssz<E: EthSpec>(
&self,
bid: &SignedExecutionPayloadBid<E>,
fork_name: ForkName,
@@ -2876,7 +2876,7 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("execution_payload_bid");
.push("execution_payload_bids");
self.post_generic_with_consensus_version_and_ssz_body(
path,
@@ -2889,8 +2889,8 @@ impl BeaconNodeHttpClient {
Ok(())
}
/// Path for `v1/beacon/execution_payload_envelope/{block_id}`
pub fn get_beacon_execution_payload_envelope_path(
/// Path for `v1/beacon/execution_payload_envelopes/{block_id}`
pub fn get_beacon_execution_payload_envelopes_path(
&self,
block_id: BlockId,
) -> Result<Url, Error> {
@@ -2898,35 +2898,35 @@ impl BeaconNodeHttpClient {
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("execution_payload_envelope")
.push("execution_payload_envelopes")
.push(&block_id.to_string());
Ok(path)
}
/// `GET v1/beacon/execution_payload_envelope/{block_id}`
/// `GET v1/beacon/execution_payload_envelopes/{block_id}`
///
/// Returns `Ok(None)` on a 404 error.
pub async fn get_beacon_execution_payload_envelope<E: EthSpec>(
pub async fn get_beacon_execution_payload_envelopes<E: EthSpec>(
&self,
block_id: BlockId,
) -> Result<
Option<ExecutionOptimisticFinalizedBeaconResponse<SignedExecutionPayloadEnvelope<E>>>,
Error,
> {
let path = self.get_beacon_execution_payload_envelope_path(block_id)?;
let path = self.get_beacon_execution_payload_envelopes_path(block_id)?;
self.get_opt(path)
.await
.map(|opt| opt.map(BeaconResponse::ForkVersioned))
}
/// `GET v1/beacon/execution_payload_envelope/{block_id}` in SSZ format
/// `GET v1/beacon/execution_payload_envelopes/{block_id}` in SSZ format
///
/// Returns `Ok(None)` on a 404 error.
pub async fn get_beacon_execution_payload_envelope_ssz<E: EthSpec>(
pub async fn get_beacon_execution_payload_envelopes_ssz<E: EthSpec>(
&self,
block_id: BlockId,
) -> Result<Option<SignedExecutionPayloadEnvelope<E>>, Error> {
let path = self.get_beacon_execution_payload_envelope_path(block_id)?;
let path = self.get_beacon_execution_payload_envelopes_path(block_id)?;
let opt_response = self
.get_bytes_opt_accept_header(path, Accept::Ssz, self.timeouts.get_beacon_blocks_ssz)
.await?;