mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
Fix ssz formatting for /light_client/updates beacon API endpoint (#7806)
#7759 We were incorrectly encoding the full response from `/light_client/updates` instead of only encoding the light client update
This commit is contained in:
@@ -981,6 +981,32 @@ impl BeaconNodeHttpClient {
|
||||
})
|
||||
}
|
||||
|
||||
/// `GET beacon/light_client/updates`
|
||||
///
|
||||
/// Returns `Ok(None)` on a 404 error.
|
||||
pub async fn get_beacon_light_client_updates_ssz<E: EthSpec>(
|
||||
&self,
|
||||
start_period: u64,
|
||||
count: u64,
|
||||
) -> Result<Option<Vec<u8>>, Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("beacon")
|
||||
.push("light_client")
|
||||
.push("updates");
|
||||
|
||||
path.query_pairs_mut()
|
||||
.append_pair("start_period", &start_period.to_string());
|
||||
|
||||
path.query_pairs_mut()
|
||||
.append_pair("count", &count.to_string());
|
||||
|
||||
self.get_bytes_opt_accept_header(path, Accept::Ssz, self.timeouts.default)
|
||||
.await
|
||||
}
|
||||
|
||||
/// `GET beacon/light_client/bootstrap`
|
||||
///
|
||||
/// Returns `Ok(None)` on a 404 error.
|
||||
|
||||
Reference in New Issue
Block a user