From 25b742d24ea7577472759f1134047f06e06c2f96 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 26 Jun 2020 12:42:12 +0300 Subject: [PATCH] cache: prevent TestRelayCache_Add failures random.Bytes() might be not random enough. --- pkg/core/cache/cache_test.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/core/cache/cache_test.go b/pkg/core/cache/cache_test.go index e8288e2d7..487f29e96 100644 --- a/pkg/core/cache/cache_test.go +++ b/pkg/core/cache/cache_test.go @@ -1,11 +1,9 @@ package cache import ( - "math/rand" "testing" "github.com/nspcc-dev/neo-go/pkg/crypto/hash" - "github.com/nspcc-dev/neo-go/pkg/internal/random" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/stretchr/testify/require" ) @@ -56,7 +54,7 @@ func (h testHashable) Hash() util.Uint256 { return hash.Sha256(h) } func getDifferentItems(t *testing.T, n int) []testHashable { items := make([]testHashable, n) for i := range items { - items[i] = random.Bytes(rand.Int() % 10) + items[i] = []byte{byte(i)} } return items }