mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-17 11:52:42 +00:00
Add method to calculate the underlying number of bytes
Required for part of attestation validation logic
This commit is contained in:
@@ -199,6 +199,10 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn bytes_for_bits(bits: usize) -> usize {
|
||||
(bits.saturating_sub(1) / 8) + 1
|
||||
}
|
||||
|
||||
impl From<ParentHashesError> for AttestationValidationError {
|
||||
fn from(e: ParentHashesError) -> Self {
|
||||
match e {
|
||||
@@ -243,4 +247,4 @@ impl From<SignatureVerificationError> for AttestationValidationError {
|
||||
=> AttestationValidationError::OutOfBoundsBitfieldIndex,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user