cache cleanup

This commit is contained in:
realbigsean
2023-03-15 17:21:18 -04:00
parent 49862c7e48
commit 73ab4d85d7
7 changed files with 75 additions and 81 deletions

View File

@@ -1,5 +1,5 @@
use crate::test_utils::TestRandom;
use crate::*;
use crate::{blobs_sidecar::KzgCommitments, test_utils::TestRandom};
use derivative::Derivative;
use serde_derive::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};

View File

@@ -1,5 +1,6 @@
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};
@@ -34,7 +35,6 @@ pub struct BlobIdentifier {
#[derivative(PartialEq, Hash(bound = "T: EthSpec"))]
pub struct BlobSidecar<T: EthSpec> {
pub block_root: Hash256,
// TODO: fix the type, should fit in u8 as well
#[serde(with = "eth2_serde_utils::quoted_u64")]
pub index: u64,
pub slot: Slot,
@@ -52,6 +52,13 @@ 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 {
block_root: self.block_root,
index: self.index,
}
}
pub fn empty() -> Self {
Self::default()
}
@@ -61,4 +68,4 @@ impl<T: EthSpec> BlobSidecar<T> {
// Fixed part
Self::empty().as_ssz_bytes().len()
}
}
}

View File

@@ -228,4 +228,4 @@ pub use bls::{
pub use kzg::{KzgCommitment, KzgProof};
pub use ssz_types::{typenum, typenum::Unsigned, BitList, BitVector, FixedVector, VariableList};
pub use superstruct::superstruct;
pub use superstruct::superstruct;

View File

@@ -581,4 +581,4 @@ mod test {
assert_eq!(reconstructed, block);
}
}
}
}