mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 12:47:05 +00:00
Merge branch 'gloas-post-bid-api' into glamsterdam-devnet-4
This commit is contained in:
@@ -46,7 +46,10 @@ use ssz::{Decode, Encode};
|
||||
use std::fmt;
|
||||
use std::future::Future;
|
||||
use std::time::Duration;
|
||||
use types::{PayloadAttestationData, PayloadAttestationMessage, SignedProposerPreferences};
|
||||
use types::{
|
||||
PayloadAttestationData, PayloadAttestationMessage, SignedExecutionPayloadBid,
|
||||
SignedProposerPreferences,
|
||||
};
|
||||
|
||||
pub const V1: EndpointVersion = EndpointVersion(1);
|
||||
pub const V2: EndpointVersion = EndpointVersion(2);
|
||||
@@ -2838,6 +2841,78 @@ impl BeaconNodeHttpClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST v1/beacon/execution_payload_bid`
|
||||
pub async fn post_beacon_execution_payload_bid<E: EthSpec>(
|
||||
&self,
|
||||
bid: &SignedExecutionPayloadBid<E>,
|
||||
fork_name: ForkName,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("beacon")
|
||||
.push("execution_payload_bid");
|
||||
|
||||
self.post_generic_with_consensus_version(
|
||||
path,
|
||||
bid,
|
||||
Some(self.timeouts.proposal),
|
||||
fork_name,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST v1/beacon/execution_payload_bid` with raw bytes (for testing invalid SSZ)
|
||||
pub async fn post_beacon_execution_payload_bid_raw_ssz(
|
||||
&self,
|
||||
bytes: &[u8],
|
||||
fork_name: ForkName,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("beacon")
|
||||
.push("execution_payload_bid");
|
||||
|
||||
self.post_generic_with_consensus_version_and_ssz_body(
|
||||
path,
|
||||
bytes.to_vec(),
|
||||
Some(self.timeouts.proposal),
|
||||
fork_name,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// `POST v1/beacon/execution_payload_bid` in SSZ format
|
||||
pub async fn post_beacon_execution_payload_bid_ssz<E: EthSpec>(
|
||||
&self,
|
||||
bid: &SignedExecutionPayloadBid<E>,
|
||||
fork_name: ForkName,
|
||||
) -> Result<(), Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("beacon")
|
||||
.push("execution_payload_bid");
|
||||
|
||||
self.post_generic_with_consensus_version_and_ssz_body(
|
||||
path,
|
||||
bid.as_ssz_bytes(),
|
||||
Some(self.timeouts.proposal),
|
||||
fork_name,
|
||||
)
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Path for `v1/beacon/execution_payload_envelope/{block_id}`
|
||||
pub fn get_beacon_execution_payload_envelope_path(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user