From e3005efb3d37210a7b0bd8501e5cf806b439cab6 Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Fri, 20 Jul 2018 17:47:29 +1000 Subject: [PATCH] Add zero() method for Block --- src/state/block.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/state/block.rs b/src/state/block.rs index cb6e1fb02..adc028a12 100644 --- a/src/state/block.rs +++ b/src/state/block.rs @@ -31,6 +31,20 @@ impl Block { sig: None } } + + pub fn zero() -> Block { + Block { + parent_hash: Sha256Digest::zero(), + skip_count: 0, + randao_reveal: Sha256Digest::zero(), + attestation_bitfield: Bitfield::new(), + attestation_aggregate_sig: AggregateSignature::new(), + shard_aggregate_votes: vec![], + main_chain_ref: Sha256Digest::zero(), + state_hash: StateHash::zero(), + sig: None + } + } /* * Take a Block and covert it into an array of u8 for BLS signing