cache: prevent TestRelayCache_Add failures

random.Bytes() might be not random enough.
This commit is contained in:
Roman Khimov 2020-06-26 12:42:12 +03:00
parent cefad683e3
commit 25b742d24e

View file

@ -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
}