sharding: treated rlp error similar to transactions

Former-commit-id: fe1aa2a4427d8cc68a8f3b91d1c4f08b2f41b4b6 [formerly e1202f47345cb9aa3b37663573e2a07703b29c47]
Former-commit-id: 324cc86345ff6666c94914b30cadbf136b4a3cee
This commit is contained in:
Eli 2018-06-12 10:11:22 -07:00
parent 2af0893602
commit fb3e26159b
2 changed files with 1 additions and 10 deletions

View File

@ -220,9 +220,6 @@ func (ch Chunks) Len() int { return len(ch) }
// GetRlp returns the RLP encoding of one chunk from the list.
func (ch Chunks) GetRlp(i int) []byte {
bytes, err := rlp.EncodeToBytes(ch[i])
if err != nil {
panic(err)
}
bytes, _ := rlp.EncodeToBytes(ch[i])
return bytes
}

View File

@ -1,8 +1,6 @@
package sharding
import (
"fmt"
"bytes"
"crypto/rand"
"math/big"
@ -141,13 +139,9 @@ func Test_CalculatePOC(t *testing.T) {
makeTxWithGasLimit(100),
}
c := NewCollation(header, body, transactions)
c.CalculateChunkRoot()
salt := []byte{1, 0x9f}
fmt.Printf("%x\n", c.header.data.ChunkRoot)
poc := c.CalculatePOC(salt)
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)