diff --git a/shared/hashutil/merkleRoot.go b/shared/hashutil/merkleRoot.go index 352d4ea064e3..629a8494e233 100644 --- a/shared/hashutil/merkleRoot.go +++ b/shared/hashutil/merkleRoot.go @@ -12,12 +12,6 @@ package hashutil func MerkleRoot(values [][]byte) []byte { length := len(values) - // Data is hashed so as to be stored as leaves in the tree. - for i, v := range values { - hashedValue := Hash(v) - values[i] = hashedValue[:] - } - newSet := make([][]byte, length, length*2) newSet = append(newSet, values...) diff --git a/shared/hashutil/merkleRoot_test.go b/shared/hashutil/merkleRoot_test.go index 5c908ccd5ba7..e9f32cc202ac 100644 --- a/shared/hashutil/merkleRoot_test.go +++ b/shared/hashutil/merkleRoot_test.go @@ -13,10 +13,10 @@ func TestMerkleRoot(t *testing.T) { {'d'}, } - hashedV1 := Hash([]byte{'a'}) - hashedV2 := Hash([]byte{'b'}) - hashedV3 := Hash([]byte{'c'}) - hashedV4 := Hash([]byte{'d'}) + hashedV1 :=[]byte{'a'} + hashedV2 := []byte{'b'} + hashedV3 := []byte{'c'} + hashedV4 := []byte{'d'} leftNode := Hash(append(hashedV1[:], hashedV2[:]...)) rightNode := Hash(append(hashedV3[:], hashedV4[:]...))