mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 13:58:28 +00:00
general chaos
This commit is contained in:
@@ -48,6 +48,7 @@ pub struct BlobSidecar<T: EthSpec> {
|
||||
}
|
||||
|
||||
pub type BlobSidecarList<T> = VariableList<BlobSidecar<T>, <T as EthSpec>::MaxBlobsPerBlock>;
|
||||
pub type Blobs<T> = VariableList<Blob<T>, <T as EthSpec>::MaxExtraDataBytes>;
|
||||
|
||||
impl<T: EthSpec> SignedRoot for BlobSidecar<T> {}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ pub mod sqlite;
|
||||
pub mod beacon_block_and_blob_sidecars;
|
||||
pub mod blob_sidecar;
|
||||
pub mod signed_blob;
|
||||
pub mod signed_block_and_blobs;
|
||||
pub mod transaction;
|
||||
|
||||
use ethereum_types::{H160, H256};
|
||||
@@ -181,9 +180,6 @@ pub use crate::signed_beacon_block::{
|
||||
};
|
||||
pub use crate::signed_beacon_block_header::SignedBeaconBlockHeader;
|
||||
pub use crate::signed_blob::*;
|
||||
pub use crate::signed_block_and_blobs::{
|
||||
SignedBeaconBlockAndBlobsSidecar, SignedBeaconBlockAndBlobsSidecarDecode,
|
||||
};
|
||||
pub use crate::signed_bls_to_execution_change::SignedBlsToExecutionChange;
|
||||
pub use crate::signed_contribution_and_proof::SignedContributionAndProof;
|
||||
pub use crate::signed_voluntary_exit::SignedVoluntaryExit;
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
use crate::{
|
||||
AbstractExecPayload, EthSpec, SignedBeaconBlock, SignedBeaconBlockEip4844,
|
||||
SignedBlobSidecar,
|
||||
};
|
||||
use crate::{BlobsSidecar, EthSpec, SignedBeaconBlock, SignedBeaconBlockEip4844};
|
||||
use derivative::Derivative;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use ssz::{Decode, DecodeError};
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use std::sync::Arc;
|
||||
use tree_hash_derive::TreeHash;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, PartialEq)]
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
pub struct SignedBeaconBlockAndBlobsSidecarDecode<T: EthSpec> {
|
||||
pub beacon_block: SignedBeaconBlockEip4844<T>,
|
||||
pub blobs_sidecar: BlobsSidecar<T>,
|
||||
}
|
||||
|
||||
// TODO: will be removed once we decouple blobs in Gossip
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, Derivative)]
|
||||
#[derivative(PartialEq, Hash(bound = "T: EthSpec"))]
|
||||
pub struct SignedBeaconBlockAndBlobsSidecar<T: EthSpec> {
|
||||
pub beacon_block: Arc<SignedBeaconBlock<T>>,
|
||||
pub blobs_sidecar: Arc<BlobsSidecar<T>>,
|
||||
}
|
||||
|
||||
impl<T: EthSpec> SignedBeaconBlockAndBlobsSidecar<T> {
|
||||
pub fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError> {
|
||||
let SignedBeaconBlockAndBlobsSidecarDecode {
|
||||
beacon_block,
|
||||
blobs_sidecar,
|
||||
} = SignedBeaconBlockAndBlobsSidecarDecode::from_ssz_bytes(bytes)?;
|
||||
Ok(SignedBeaconBlockAndBlobsSidecar {
|
||||
beacon_block: Arc::new(SignedBeaconBlock::Eip4844(beacon_block)),
|
||||
blobs_sidecar: Arc::new(blobs_sidecar),
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user