diff --git a/eth2/types/src/beacon_block/mod.rs b/eth2/types/src/beacon_block/mod.rs index 9b58b27ee2..c736c07353 100644 --- a/eth2/types/src/beacon_block/mod.rs +++ b/eth2/types/src/beacon_block/mod.rs @@ -20,9 +20,7 @@ pub struct BeaconBlock { impl BeaconBlock { pub fn canonical_root(&self) -> Hash256 { - // TODO: implement tree hashing. - // https://github.com/sigp/lighthouse/issues/70 - Hash256::from(&canonical_hash(&ssz_encode(self))[..]) + Hash256::from(&self.hash_tree_root()[..]) } } diff --git a/eth2/types/src/beacon_state/mod.rs b/eth2/types/src/beacon_state/mod.rs index 32cc7d829c..f8f458ae17 100644 --- a/eth2/types/src/beacon_state/mod.rs +++ b/eth2/types/src/beacon_state/mod.rs @@ -64,9 +64,7 @@ pub struct BeaconState { impl BeaconState { pub fn canonical_root(&self) -> Hash256 { - // TODO: implement tree hashing. - // https://github.com/sigp/lighthouse/issues/70 - Hash256::from(&canonical_hash(&ssz_encode(self))[..]) + Hash256::from(&self.hash_tree_root()[..]) } }