From 8429f3bff1f511315d0c215a53a5e5b2ff979a9b Mon Sep 17 00:00:00 2001 From: Johns Beharry Date: Thu, 28 Feb 2019 15:59:45 +0100 Subject: [PATCH] chore(hashing): update comments of fn merkle_root Signed-off-by: Johns Beharry --- eth2/utils/hashing/src/lib.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/eth2/utils/hashing/src/lib.rs b/eth2/utils/hashing/src/lib.rs index 33c31ab190..3f544d2c1b 100644 --- a/eth2/utils/hashing/src/lib.rs +++ b/eth2/utils/hashing/src/lib.rs @@ -8,13 +8,11 @@ pub fn hash(input: &[u8]) -> Vec { result } -/// Generate Merkle Root -/// -/// Outputs a `Vec` byte array of the merkle root given a set of leaf node values. -/// Expects leaf nodes to already be hashed. +// Get merkle root of some hashed values - the input leaf nodes is expected to already be hashed +// Outputs a `Vec` byte array of the merkle root given a set of leaf node values. pub fn merkle_root(values: &[Vec]) -> Vec { let values_len = values.len(); - + // vector to store hashes // filled with 0 as placeholders let mut o: Vec> = vec![vec![0]; values_len]; @@ -82,6 +80,5 @@ mod tests { let expected = hash(&root[..]); assert_eq!(&expected[..], output.as_slice()); - } }