Add ssz for AttestationRecord

This commit is contained in:
Paul Hauner 2018-09-10 07:51:44 +02:00
parent 67bbc75c86
commit 976e3a717e

View File

@ -1,5 +1,6 @@
use super::utils::types::{ Hash256, Bitfield }; use super::utils::types::{ Hash256, Bitfield };
use super::utils::bls::{ AggregateSignature }; use super::utils::bls::{ AggregateSignature };
use super::ssz::{ Encodable, SszStream };
pub struct AttestationRecord { pub struct AttestationRecord {
@ -11,6 +12,17 @@ pub struct AttestationRecord {
pub aggregate_sig: Option<AggregateSignature>, pub aggregate_sig: Option<AggregateSignature>,
} }
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 { impl AttestationRecord {
pub fn zero() -> Self { pub fn zero() -> Self {
Self { Self {