mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-18 05:18:30 +00:00
fix compile
This commit is contained in:
@@ -713,14 +713,14 @@ impl BeaconNodeHttpClient {
|
||||
/// `POST v2/beacon/blocks`
|
||||
pub async fn post_beacon_blocks_v2<T: EthSpec, Payload: AbstractExecPayload<T>>(
|
||||
&self,
|
||||
block: &SignedBeaconBlock<T, Payload>,
|
||||
block_contents: &SignedBlockContents<T, Payload>,
|
||||
validation_level: Option<BroadcastValidation>,
|
||||
) -> Result<(), Error> {
|
||||
self.post_generic_with_consensus_version(
|
||||
self.post_beacon_blocks_v2_path(validation_level)?,
|
||||
block,
|
||||
block_contents,
|
||||
Some(self.timeouts.proposal),
|
||||
block.message().body().fork_name(),
|
||||
block_contents.signed_block().message().body().fork_name(),
|
||||
)
|
||||
.await?;
|
||||
|
||||
@@ -728,6 +728,7 @@ impl BeaconNodeHttpClient {
|
||||
}
|
||||
|
||||
/// `POST v2/beacon/blinded_blocks`
|
||||
//TODO(sean) update this along with builder updates
|
||||
pub async fn post_beacon_blinded_blocks_v2<T: EthSpec>(
|
||||
&self,
|
||||
block: &SignedBlindedBeaconBlock<T>,
|
||||
|
||||
@@ -9,6 +9,7 @@ use ssz_derive::Encode;
|
||||
use std::convert::TryFrom;
|
||||
use std::fmt::{self, Display};
|
||||
use std::str::{from_utf8, FromStr};
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
pub use types::*;
|
||||
|
||||
@@ -1409,6 +1410,8 @@ pub type BlockContentsTuple<T, Payload> = (
|
||||
Option<SignedBlobSidecarList<T>>,
|
||||
);
|
||||
|
||||
pub type ArcBlockContentsTuple<T> = (Arc<SignedBeaconBlock<T>>, Option<SignedBlobSidecarList<T>>);
|
||||
|
||||
/// A wrapper over a [`SignedBeaconBlock`] or a [`SignedBeaconBlockAndBlobSidecars`].
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
@@ -1419,6 +1422,20 @@ pub enum SignedBlockContents<T: EthSpec, Payload: AbstractExecPayload<T> = FullP
|
||||
}
|
||||
|
||||
impl<T: EthSpec, Payload: AbstractExecPayload<T>> SignedBlockContents<T, Payload> {
|
||||
pub fn new(
|
||||
block: SignedBeaconBlock<T, Payload>,
|
||||
blobs: Option<SignedBlobSidecarList<T>>,
|
||||
) -> Self {
|
||||
if let Some(blobs) = blobs {
|
||||
Self::BlockAndBlobSidecars(SignedBeaconBlockAndBlobSidecars {
|
||||
signed_block: block,
|
||||
signed_blob_sidecars: blobs,
|
||||
})
|
||||
} else {
|
||||
Self::Block(block)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn signed_block(&self) -> &SignedBeaconBlock<T, Payload> {
|
||||
match self {
|
||||
SignedBlockContents::BlockAndBlobSidecars(block_and_sidecars) => {
|
||||
|
||||
Reference in New Issue
Block a user