forked from TrueCloudLab/neoneo-go
cache: prevent TestRelayCache_Add failures
random.Bytes() might be not random enough.
This commit is contained in:
parent
cefad683e3
commit
25b742d24e
1 changed files with 1 additions and 3 deletions
4
pkg/core/cache/cache_test.go
vendored
4
pkg/core/cache/cache_test.go
vendored
|
@ -1,11 +1,9 @@
|
||||||
package cache
|
package cache
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/rand"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
|
"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/nspcc-dev/neo-go/pkg/util"
|
||||||
"github.com/stretchr/testify/require"
|
"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 {
|
func getDifferentItems(t *testing.T, n int) []testHashable {
|
||||||
items := make([]testHashable, n)
|
items := make([]testHashable, n)
|
||||||
for i := range items {
|
for i := range items {
|
||||||
items[i] = random.Bytes(rand.Int() % 10)
|
items[i] = []byte{byte(i)}
|
||||||
}
|
}
|
||||||
return items
|
return items
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue