From 5e81a995ea4b9d7e623c3d7720aa935be58a2aca Mon Sep 17 00:00:00 2001 From: Paul Hauner Date: Wed, 17 Apr 2019 18:54:39 +1000 Subject: [PATCH] Use signed_root for canonical header ID --- eth2/types/src/beacon_block_header.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth2/types/src/beacon_block_header.rs b/eth2/types/src/beacon_block_header.rs index fa71bd26b..e4db3a721 100644 --- a/eth2/types/src/beacon_block_header.rs +++ b/eth2/types/src/beacon_block_header.rs @@ -5,7 +5,7 @@ use rand::RngCore; use serde_derive::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; -use tree_hash::TreeHash; +use tree_hash::{SignedRoot, TreeHash}; use tree_hash_derive::{SignedRoot, TreeHash}; /// A header of a `BeaconBlock`. @@ -37,7 +37,7 @@ impl BeaconBlockHeader { /// /// Spec v0.5.1 pub fn canonical_root(&self) -> Hash256 { - Hash256::from_slice(&self.tree_hash_root()[..]) + Hash256::from_slice(&self.signed_root()[..]) } /// Given a `body`, consumes `self` and returns a complete `BeaconBlock`.