mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-12 04:30:04 +00:00
sharding: treated rlp error similar to transactions
Former-commit-id: fe1aa2a4427d8cc68a8f3b91d1c4f08b2f41b4b6 [formerly e1202f47345cb9aa3b37663573e2a07703b29c47] Former-commit-id: 324cc86345ff6666c94914b30cadbf136b4a3cee
This commit is contained in:
parent
2af0893602
commit
fb3e26159b
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user