From 976e3a717ea83a9cf4baca0e3c07de79c8d148da Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Mon, 10 Sep 2018 07:51:44 +0200 Subject: [PATCH] Add ssz for AttestationRecord --- lighthouse/state/attestation_record.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lighthouse/state/attestation_record.rs b/lighthouse/state/attestation_record.rs index e8725cfd7f..46f2f9ff4f 100644 --- a/lighthouse/state/attestation_record.rs +++ b/lighthouse/state/attestation_record.rs @@ -1,5 +1,6 @@ use super::utils::types::{ Hash256, Bitfield }; use super::utils::bls::{ AggregateSignature }; +use super::ssz::{ Encodable, SszStream }; pub struct AttestationRecord { @@ -11,6 +12,17 @@ pub struct AttestationRecord { pub aggregate_sig: Option, } +impl Encodable for AttestationRecord { + fn ssz_append(&self, s: &mut SszStream) { + s.append(&self.slot); + s.append(&self.shard_id); + s.append_vec(&self.oblique_parent_hashes); + s.append(&self.shard_block_hash); + s.append(&self.attester_bitfield); + // TODO: add aggregate signature + } +} + impl AttestationRecord { pub fn zero() -> Self { Self {