mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
fix compilation issues
This commit is contained in:
@@ -19,6 +19,7 @@ hex = "0.4.2"
|
||||
eth2_hashing = "0.3.0"
|
||||
ethereum-types = "0.12.1"
|
||||
c-kzg = {git = "https://github.com/pawanjay176/c-kzg-4844", rev = "c9e4fa0dabdd000738b7fcdf85a72880a5da8748" }
|
||||
arbitrary = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
||||
[features]
|
||||
default = ["mainnet-spec"]
|
||||
|
||||
@@ -102,3 +102,12 @@ impl Debug for KzgCommitment {
|
||||
write!(f, "{}", eth2_serde_utils::hex::encode(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "arbitrary")]
|
||||
impl arbitrary::Arbitrary<'_> for KzgCommitment {
|
||||
fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
|
||||
let mut bytes = [0u8; KZG_COMMITMENT_BYTES_LEN];
|
||||
u.fill_buffer(&mut bytes)?;
|
||||
Ok(KzgCommitment(bytes))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,3 +126,12 @@ impl Debug for KzgProof {
|
||||
write!(f, "{}", eth2_serde_utils::hex::encode(&self.0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "arbitrary")]
|
||||
impl arbitrary::Arbitrary<'_> for KzgProof {
|
||||
fn arbitrary(u: &mut arbitrary::Unstructured<'_>) -> arbitrary::Result<Self> {
|
||||
let mut bytes = [0u8; KZG_PROOF_BYTES_LEN];
|
||||
u.fill_buffer(&mut bytes)?;
|
||||
Ok(KzgProof(bytes))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user