Simplifications for ./crypto (#4677)

This commit is contained in:
Michael Sproul
2023-09-06 07:22:43 +10:00
committed by GitHub
parent 2550170337
commit 13606533b5
7 changed files with 30 additions and 67 deletions

View File

@@ -11,7 +11,7 @@ harness = false
[dependencies]
merkle_proof = { path = "../../consensus/merkle_proof" }
bls = { path = "../../crypto/bls", features = ["arbitrary"] }
kzg = { path = "../../crypto/kzg", features = ["arbitrary"] }
kzg = { path = "../../crypto/kzg" }
compare_fields = { path = "../../common/compare_fields" }
compare_fields_derive = { path = "../../common/compare_fields_derive" }
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }

View File

@@ -45,7 +45,6 @@ impl Ord for BlobIdentifier {
Encode,
Decode,
TreeHash,
Default,
TestRandom,
Derivative,
arbitrary::Arbitrary,
@@ -120,7 +119,16 @@ impl<T: EthSpec> BlobSidecar<T> {
}
pub fn empty() -> Self {
Self::default()
Self {
block_root: Hash256::zero(),
index: 0,
slot: Slot::new(0),
block_parent_root: Hash256::zero(),
proposer_index: 0,
blob: Blob::<T>::default(),
kzg_commitment: KzgCommitment::empty_for_testing(),
kzg_proof: KzgProof::empty(),
}
}
pub fn random_valid<R: Rng>(rng: &mut R, kzg: &Kzg<T::Kzg>) -> Result<Self, String> {
@@ -154,7 +162,7 @@ impl<T: EthSpec> BlobSidecar<T> {
blob,
kzg_commitment: commitment,
kzg_proof: proof,
..Default::default()
..Self::empty()
})
}
@@ -198,7 +206,6 @@ impl<T: EthSpec> BlobSidecar<T> {
Encode,
Decode,
TreeHash,
Default,
TestRandom,
Derivative,
arbitrary::Arbitrary,