parent
ad62e1e35c
commit
73d86bcc3b
@ -20,9 +20,7 @@ pub struct BeaconBlock {
|
|||||||
|
|
||||||
impl BeaconBlock {
|
impl BeaconBlock {
|
||||||
pub fn canonical_root(&self) -> Hash256 {
|
pub fn canonical_root(&self) -> Hash256 {
|
||||||
// TODO: implement tree hashing.
|
Hash256::from(&self.hash_tree_root()[..])
|
||||||
// https://github.com/sigp/lighthouse/issues/70
|
|
||||||
Hash256::from(&canonical_hash(&ssz_encode(self))[..])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,9 +64,7 @@ pub struct BeaconState {
|
|||||||
|
|
||||||
impl BeaconState {
|
impl BeaconState {
|
||||||
pub fn canonical_root(&self) -> Hash256 {
|
pub fn canonical_root(&self) -> Hash256 {
|
||||||
// TODO: implement tree hashing.
|
Hash256::from(&self.hash_tree_root()[..])
|
||||||
// https://github.com/sigp/lighthouse/issues/70
|
|
||||||
Hash256::from(&canonical_hash(&ssz_encode(self))[..])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user