Add attestation aggregation to BeaconChain

This commit is contained in:
Paul Hauner
2019-01-28 13:04:50 +11:00
parent e9abf06364
commit e1698102e0
3 changed files with 138 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ use crate::test_utils::TestRandom;
use rand::RngCore;
use serde_derive::Serialize;
use ssz::{hash, Decodable, DecodeError, Encodable, SszStream, TreeHash};
use std::hash::Hash;
mod signing;
@@ -17,7 +18,7 @@ pub const SSZ_ATTESTION_DATA_LENGTH: usize = {
32 // justified_block_root
};
#[derive(Debug, Clone, PartialEq, Default, Serialize)]
#[derive(Debug, Clone, PartialEq, Default, Serialize, Hash)]
pub struct AttestationData {
pub slot: u64,
pub shard: u64,
@@ -29,6 +30,8 @@ pub struct AttestationData {
pub justified_block_root: Hash256,
}
impl Eq for AttestationData {}
impl AttestationData {
pub fn zero() -> Self {
Self {