mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 04:48:21 +00:00
block and blob handling progress
This commit is contained in:
@@ -7,7 +7,27 @@ use tree_hash_derive::TreeHash;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, PartialEq)]
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
pub struct SignedBeaconBlockAndBlobsSidecar<T: EthSpec> {
|
||||
pub struct SignedBeaconBlockAndBlobsSidecarDecode<T: EthSpec> {
|
||||
pub beacon_block: SignedBeaconBlockEip4844<T>,
|
||||
pub blobs_sidecar: BlobsSidecar<T>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, PartialEq)]
|
||||
#[serde(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