mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-04 19:19:44 +00:00
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
|
||||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue