remove blob wrapper

This commit is contained in:
realbigsean
2022-11-19 15:18:42 -05:00
parent dfd0013eab
commit 45897ad4e1
21 changed files with 199 additions and 159 deletions

View File

@@ -150,7 +150,6 @@ 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::{
@@ -172,6 +171,7 @@ pub use crate::signed_beacon_block::{
SignedBlindedBeaconBlock,
};
pub use crate::signed_beacon_block_header::SignedBeaconBlockHeader;
pub use crate::signed_block_and_blobs::SignedBeaconBlockAndBlobsSidecar;
pub use crate::signed_contribution_and_proof::SignedContributionAndProof;
pub use crate::signed_voluntary_exit::SignedVoluntaryExit;
pub use crate::signing_data::{SignedRoot, SigningData};

View File

@@ -1,37 +1,13 @@
use std::sync::Arc;
use serde_derive::{Deserialize, Serialize};
use ssz::{Decode, DecodeError};
use ssz_derive::{Decode, Encode};
use tree_hash_derive::TreeHash;
use crate::{BlobsSidecar, EthSpec, SignedBeaconBlock, SignedBeaconBlockEip4844};
use serde_derive::{Deserialize, Serialize};
use ssz::{Decode, DecodeError, Encode};
use ssz_derive::{Decode, Encode};
use std::sync::Arc;
use tree_hash_derive::TreeHash;
#[derive(Debug, Clone, Serialize, Deserialize, Encode, TreeHash, PartialEq)]
#[derive(Debug, Clone, Serialize, Deserialize, Encode, Decode, TreeHash, PartialEq)]
#[serde(bound = "T: EthSpec")]
pub struct SignedBeaconBlockAndBlobsSidecar<T: EthSpec> {
pub beacon_block: SignedBeaconBlock<T>,
pub beacon_block: SignedBeaconBlockEip4844<T>,
pub blobs_sidecar: BlobsSidecar<T>,
}
impl <T: EthSpec>Decode for SignedBeaconBlockAndBlobsSidecar<T> {
fn is_ssz_fixed_len() -> bool {
todo!()
}
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError> {
todo!()
}
}
pub enum BlockMaybeBlobs<T: EthSpec> {
Block(Arc<SignedBeaconBlock<T>>),
BlockAndBlobs(Arc<SignedBeaconBlockAndBlobsSidecar<T>>),
}
impl <T: EthSpec> BlockMaybeBlobs<T> {
pub fn blobs(&self) -> Option<&BlobsSidecar<T>>{
match self {
Self::Block(_) => None,
Self::BlockAndBlobs(block_and_blobs) => Some(&block_and_blobs.blobs_sidecar)
}
}
}