mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
started dpa_test
This commit is contained in:
parent
71f1695b87
commit
dca79894d1
3 changed files with 12 additions and 13 deletions
|
|
@ -2,7 +2,6 @@ package bzz
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/rand"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -14,15 +13,6 @@ import (
|
||||||
Tests TreeChunker by splitting and joining a random byte slice
|
Tests TreeChunker by splitting and joining a random byte slice
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func testDataReader(l int) (r *ChunkReader, slice []byte) {
|
|
||||||
slice = make([]byte, l)
|
|
||||||
if _, err := rand.Read(slice); err != nil {
|
|
||||||
panic("rand error")
|
|
||||||
}
|
|
||||||
r = NewChunkReaderFromBytes(slice)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
type chunkerTester struct {
|
type chunkerTester struct {
|
||||||
errors []error
|
errors []error
|
||||||
chunks []*Chunk
|
chunks []*Chunk
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,15 @@ import (
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func testDataReader(l int) (r *ChunkReader, slice []byte) {
|
||||||
|
slice = make([]byte, l)
|
||||||
|
if _, err := rand.Read(slice); err != nil {
|
||||||
|
panic("rand error")
|
||||||
|
}
|
||||||
|
r = NewChunkReaderFromBytes(slice)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
func randomChunks(l int64, branches int64, chunkC chan *Chunk) (key Key, errC chan error) {
|
func randomChunks(l int64, branches int64, chunkC chan *Chunk) (key Key, errC chan error) {
|
||||||
chunker := &TreeChunker{
|
chunker := &TreeChunker{
|
||||||
Branches: branches,
|
Branches: branches,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
// test bench for the package blockhash
|
|
||||||
|
|
||||||
package bzz
|
package bzz
|
||||||
|
|
||||||
import ()
|
import (
|
||||||
|
// "github.com/ethereum/go-ethereum/bzz/test"
|
||||||
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue