Half update some ssz indexes for ssz_block

This commit is contained in:
Paul Hauner
2018-09-19 17:15:54 +10:00
parent ca951d0361
commit 1dd1714444

View File

@@ -52,7 +52,7 @@ impl<'a> SszBlock<'a> {
* and ensure that length is enough to store at least one attestation * and ensure that length is enough to store at least one attestation
* record. * record.
*/ */
let attestation_len = decode_length(ssz, 72, LENGTH_BYTES) let attestation_len = decode_length(ssz, 80, LENGTH_BYTES)
.map_err(|_| BlockValidatorError::TooShort)?; .map_err(|_| BlockValidatorError::TooShort)?;
if len < (76 + attestation_len + 96) { if len < (76 + attestation_len + 96) {
return Err(BlockValidatorError::TooShort); return Err(BlockValidatorError::TooShort);
@@ -69,7 +69,7 @@ impl<'a> SszBlock<'a> {
} }
pub fn parent_hash(&self) -> &[u8] { pub fn parent_hash(&self) -> &[u8] {
&self.ssz[0..32] &self.ssz[5..37]
} }
pub fn slot_number(&self) -> u64 { pub fn slot_number(&self) -> u64 {