Skip to content

Commit

Permalink
*: fix staticcheck warnings about rand.* use
Browse files Browse the repository at this point in the history
It's just a test code.

Signed-off-by: Roman Khimov <roman@nspcc.ru>
  • Loading branch information
roman-khimov committed Feb 26, 2024
1 parent 4a5da31 commit 5c1d6b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion contracts/alphabet/migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func replaceArgI(vs []any, i int, v any) []any {
}

func randUint160() (u util.Uint160) {
rand.Read(u[:])
rand.Read(u[:]) //nolint:staticcheck // SA1019: rand.Read has been deprecated since Go 1.20
return
}

Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ import (

func randomBytes(n int) []byte {
a := make([]byte, n)
rand.Read(a)
rand.Read(a) //nolint:staticcheck // SA1019: rand.Read has been deprecated since Go 1.20
return a
}
6 changes: 3 additions & 3 deletions tests/netmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type testNodeInfo struct {

func dummyNodeInfo(acc neotest.Signer) testNodeInfo {
ni := make([]byte, 66)
rand.Read(ni)
rand.Read(ni) //nolint:staticcheck // SA1019: rand.Read has been deprecated since Go 1.20

s := acc.(neotest.SingleSigner)
pub := s.Account().PrivateKey().PublicKey().Bytes()
Expand Down Expand Up @@ -105,7 +105,7 @@ func TestAddPeer(t *testing.T) {
}

func TestNewEpoch(t *testing.T) {
rand.Seed(42)
rand.Seed(42) //nolint:staticcheck // SA1019: rand.Seed has been deprecated since Go 1.20

const epochCount = netmap.DefaultSnapshotCount * 2

Expand Down Expand Up @@ -214,7 +214,7 @@ func TestSubscribeForNewEpoch(t *testing.T) {
}

func TestUpdateSnapshotCount(t *testing.T) {
rand.Seed(42)
rand.Seed(42) //nolint:staticcheck // SA1019: rand.Seed has been deprecated since Go 1.20

require.True(t, netmap.DefaultSnapshotCount > 5) // sanity check, adjust tests if false.

Expand Down

0 comments on commit 5c1d6b3

Please sign in to comment.