From 96c20124344c9ba7992f24db1fd5a8754dd0f9ba Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Thu, 13 Dec 2018 17:32:48 +1100 Subject: [PATCH] Add canonical_hash method to `BeaconState` --- beacon_chain/types/src/beacon_state.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/beacon_chain/types/src/beacon_state.rs b/beacon_chain/types/src/beacon_state.rs index efd04b551..a3e83a523 100644 --- a/beacon_chain/types/src/beacon_state.rs +++ b/beacon_chain/types/src/beacon_state.rs @@ -43,3 +43,11 @@ pub struct BeaconState { pub processed_pow_receipt_root: Hash256, pub candidate_pow_receipt_roots: Vec, } + +impl BeaconState { + pub fn canonical_root(&self) -> Hash256 { + // TODO: implement tree hashing. + // https://github.com/sigp/lighthouse/issues/70 + Hash256::zero() + } +}