aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/network/stream/intervals_test.go
diff options
context:
space:
mode:
authorAlexey Sharov <www.pismeco@gmail.com>2018-11-14 16:21:14 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2018-11-14 16:21:14 +0800
commiteb8fa3cc89ae3a3247c649486839b1c250554d2d (patch)
treec61b8ebebc739db0e5413cd214fdd0d3da2fe61e /swarm/network/stream/intervals_test.go
parentcff97119a713a6f790893aaf1c172a397a48bf33 (diff)
downloaddexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.gz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.bz2
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.lz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.xz
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.tar.zst
dexon-eb8fa3cc89ae3a3247c649486839b1c250554d2d.zip
cmd/swarm, swarm/api/http, swarm/bmt, swarm/fuse, swarm/network/stream, swarm/storage, swarm/storage/encryption, swarm/testutil: use pseudo-random instead of crypto-random for test files content generation (#18083)
- Replace "crypto/rand" to "math/rand" for files content generation - Remove swarm/network_test.go.Shuffle and swarm/btm/btm_test.go.Shuffle - because go1.9 support dropped (see https://github.com/ethereum/go-ethereum/pull/17807 and comments to swarm/network_test.go.Shuffle)
Diffstat (limited to 'swarm/network/stream/intervals_test.go')
-rw-r--r--swarm/network/stream/intervals_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/swarm/network/stream/intervals_test.go b/swarm/network/stream/intervals_test.go
index 0c95fabb7..037984f22 100644
--- a/swarm/network/stream/intervals_test.go
+++ b/swarm/network/stream/intervals_test.go
@@ -18,10 +18,8 @@ package stream
import (
"context"
- crand "crypto/rand"
"encoding/binary"
"fmt"
- "io"
"os"
"sync"
"testing"
@@ -36,6 +34,7 @@ import (
"github.com/ethereum/go-ethereum/swarm/network/simulation"
"github.com/ethereum/go-ethereum/swarm/state"
"github.com/ethereum/go-ethereum/swarm/storage"
+ "github.com/ethereum/go-ethereum/swarm/testutil"
)
func TestIntervalsLive(t *testing.T) {
@@ -130,7 +129,8 @@ func testIntervals(t *testing.T, live bool, history *Range, skipCheck bool) {
fileStore := item.(*storage.FileStore)
size := chunkCount * chunkSize
- _, wait, err := fileStore.Store(ctx, io.LimitReader(crand.Reader, int64(size)), int64(size), false)
+
+ _, wait, err := fileStore.Store(ctx, testutil.RandomReader(1, size), int64(size), false)
if err != nil {
log.Error("Store error: %v", "err", err)
t.Fatal(err)