mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 22:34:45 +00:00
make signed block + sidecar consensus spec
This commit is contained in:
@@ -97,6 +97,7 @@ pub mod sqlite;
|
||||
pub mod blobs_sidecar;
|
||||
pub mod kzg_commitment;
|
||||
pub mod kzg_proof;
|
||||
pub mod signed_block_and_blobs;
|
||||
|
||||
use ethereum_types::{H160, H256};
|
||||
|
||||
@@ -149,6 +150,7 @@ pub use crate::historical_batch::HistoricalBatch;
|
||||
pub use crate::indexed_attestation::IndexedAttestation;
|
||||
pub use crate::kzg_commitment::KzgCommitment;
|
||||
pub use crate::kzg_proof::KzgProof;
|
||||
pub use crate::signed_block_and_blobs::SignedBeaconBlockAndBlobsSidecar;
|
||||
pub use crate::participation_flags::ParticipationFlags;
|
||||
pub use crate::participation_list::ParticipationList;
|
||||
pub use crate::payload::{
|
||||
|
||||
18
consensus/types/src/signed_block_and_blobs.rs
Normal file
18
consensus/types/src/signed_block_and_blobs.rs
Normal file
@@ -0,0 +1,18 @@
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use ssz_derive::{Decode, Encode};
|
||||
use tree_hash_derive::TreeHash;
|
||||
use crate::{BlobsSidecar, EthSpec, SignedBeaconBlock};
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, PartialEq)]
|
||||
#[serde(bound = "T: EthSpec")]
|
||||
pub struct SignedBeaconBlockAndBlobsSidecar<T: EthSpec> {
|
||||
pub beacon_block: SignedBeaconBlock<T>,
|
||||
pub blobs_sidecar: BlobsSidecar<T>,
|
||||
}
|
||||
|
||||
impl<T: EthSpec> SignedBeaconBlockAndBlobsSidecar<T> {
|
||||
/// SSZ decode with fork variant determined by slot.
|
||||
pub fn from_ssz_bytes(bytes: &[u8], spec: &ChainSpec) -> Result<Self, ssz::DecodeError> {
|
||||
SignedBeaconBlock::from_ssz_bytes(bytes, spec)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user