Skip to content

Commit

Permalink
pad to 32 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas committed Feb 14, 2020
1 parent ffdc900 commit 576d8b0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions shared/stateutil/blocks.go
Expand Up @@ -20,9 +20,12 @@ func BlockHeaderRoot(header *ethpb.BeaconBlockHeader) ([32]byte, error) {
binary.LittleEndian.PutUint64(headerSlotBuf, header.Slot)
headerSlotRoot := bytesutil.ToBytes32(headerSlotBuf)
fieldRoots[0] = headerSlotRoot[:]
fieldRoots[1] = header.ParentRoot
fieldRoots[2] = header.StateRoot
fieldRoots[3] = header.BodyRoot
parentRoot := bytesutil.ToBytes32(header.ParentRoot)
fieldRoots[1] = parentRoot[:]
stateRoot := bytesutil.ToBytes32(header.StateRoot)
fieldRoots[2] = stateRoot[:]
bodyRoot := bytesutil.ToBytes32(header.BodyRoot)
fieldRoots[3] = bodyRoot[:]
}
return bitwiseMerkleize(fieldRoots, uint64(len(fieldRoots)), uint64(len(fieldRoots)))
}
Expand Down

0 comments on commit 576d8b0

Please sign in to comment.