Fix after rebase

This commit is contained in:
Pawan Dhananjay
2023-03-16 01:10:44 +05:30
parent 761df83597
commit bef3a54c4a
3 changed files with 12 additions and 11 deletions

View File

@@ -1,11 +1,11 @@
use crate::test_utils::TestRandom;
use crate::{Blob, EthSpec, Hash256, SignedRoot, Slot};
use bls::Signature;
use derivative::Derivative;
use kzg::{KzgCommitment, KzgProof};
use serde_derive::{Deserialize, Serialize};
use ssz::Encode;
use ssz_derive::{Decode, Encode};
use ssz_types::VariableList;
use test_random_derive::TestRandom;
use tree_hash_derive::TreeHash;
@@ -52,10 +52,6 @@ pub type BlobSidecarList<T> = VariableList<BlobSidecar<T>, <T as EthSpec>::MaxBl
impl<T: EthSpec> SignedRoot for BlobSidecar<T> {}
impl<T: EthSpec> BlobSidecar<T> {
pub fn id(&self) -> BlobIdentifier {
BlobIdentifier::new(self.block_root, self.index)
}
pub fn empty() -> Self {
Self::default()
}
@@ -65,4 +61,4 @@ impl<T: EthSpec> BlobSidecar<T> {
// Fixed part
Self::empty().as_ssz_bytes().len()
}
}
}

View File

@@ -25,7 +25,6 @@ pub mod beacon_block_body;
pub mod beacon_block_header;
pub mod beacon_committee;
pub mod beacon_state;
pub mod blob_sidecar;
pub mod bls_to_execution_change;
pub mod builder_bid;
pub mod chain_spec;
@@ -220,7 +219,6 @@ pub type BLSFieldElement = Uint256;
pub type Blob<T> = FixedVector<u8, <T as EthSpec>::BytesPerBlob>;
pub type VersionedHash = Hash256;
pub type Hash64 = ethereum_types::H64;
pub type BlobsSidecar<T> = VariableList<BlobSidecar<T>, <T as EthSpec>::MaxBlobsPerBlock>;
pub use bls::{
AggregatePublicKey, AggregateSignature, Keypair, PublicKey, PublicKeyBytes, SecretKey,
@@ -229,6 +227,5 @@ pub use bls::{
pub use kzg::{KzgCommitment, KzgProof};
use crate::blob_sidecar::BlobSidecar;
pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList};
pub use superstruct::superstruct;
pub use superstruct::superstruct;

View File

@@ -35,6 +35,14 @@ impl From<SignedBeaconBlockHash> for Hash256 {
}
}
#[derive(Debug)]
pub enum BlobReconstructionError {
/// No blobs for the specified block where we would expect blobs.
UnavailableBlobs,
/// Blobs provided for a pre-Eip4844 fork.
InconsistentFork,
}
/// A `BeaconBlock` and a signature from its proposer.
#[superstruct(
variants(Base, Altair, Merge, Capella, Eip4844),
@@ -573,4 +581,4 @@ mod test {
assert_eq!(reconstructed, block);
}
}
}
}