Former-commit-id: 1f9da258e234ee15e1b966c6b448d3d777b6f4f1 [formerly 1599e79184b460213ed219f5bbd9b29605dfd927]
Former-commit-id: 73cf4a00f38a78f0f9bf74a47ec1947915360341
This commit is contained in:
Eli 2018-06-07 10:34:21 -07:00
parent 1a8d71d768
commit 2af0893602
2 changed files with 2 additions and 3 deletions

View File

@ -104,7 +104,7 @@ func (c *Collation) ProposerAddress() *common.Address {
// CalculateChunkRoot updates the collation header's chunk root based on the body.
func (c *Collation) CalculateChunkRoot() {
chunks := BytesToChunks(c.body) // wrapper allowing us to merklizing the chunks.
chunks := BytesToChunks(c.body) // wrapper allowing us to merklizing the chunks.
chunkRoot := types.DeriveSha(chunks) // merklize the serialized blobs.
c.header.data.ChunkRoot = &chunkRoot
}
@ -120,7 +120,7 @@ func (c *Collation) CalculatePOC(salt []byte) common.Hash {
if len(c.body) == 0 {
body = salt
}
chunks := BytesToChunks(body) // wrapper allowing us to merklizing the chunks.
chunks := BytesToChunks(body) // wrapper allowing us to merklizing the chunks.
return types.DeriveSha(chunks) // merklize the serialized blobs.
}

View File

@ -149,7 +149,6 @@ func Test_CalculatePOC(t *testing.T) {
fmt.Printf("%x\n", c.header.data.ChunkRoot)
fmt.Printf("%x\n", poc)
if poc == *c.header.data.ChunkRoot {
t.Errorf("Proof of Custody with Salt: %x does not differ from ChunkRoot without salt.", salt)
}