@@ -3,11 +3,11 @@ package dkg
33import (
44 "errors"
55 "fmt"
6- "math/rand"
6+ "math/rand/v2 "
77 "testing"
88
9- clock "github.com/jonboulle/clockwork"
109 "github.com/stretchr/testify/require"
10+
1111 "go.dedis.ch/kyber/v4"
1212 "go.dedis.ch/kyber/v4/group/edwards25519"
1313 "go.dedis.ch/kyber/v4/share"
@@ -24,7 +24,6 @@ type TestNode struct {
2424 proto * Protocol
2525 phaser * TimePhaser
2626 board * TestBoard
27- clock * clock.FakeClock
2827}
2928
3029func NewTestNode (s Suite , index uint32 ) * TestNode {
@@ -212,7 +211,7 @@ func TestSelfEvictionDealer(t *testing.T) {
212211 thr := uint32 (3 )
213212 suite := edwards25519 .NewBlakeSHA256Ed25519 ()
214213 tns := GenerateTestNodes (suite , n )
215- skippedIndex := rand .Intn (int (n ))
214+ skippedIndex := rand .IntN (int (n ))
216215 var newIndex uint32 = 53 // XXX should there be a limit to the index ?
217216 tns [skippedIndex ].Index = newIndex
218217 list := NodesFromTest (tns )
@@ -290,9 +289,9 @@ func TestDKGSkipIndex(t *testing.T) {
290289 newT := thr + nodesToAdd - 1 // set the threshold to accept one offline new node
291290 var newTns = make ([]* TestNode , 0 , newN )
292291 // remove a random node from the previous group
293- offlineToRemove := uint32 ( rand .Intn (int (n ) ))
292+ offlineToRemove := rand .IntN (int (n ))
294293 for i , node := range tns {
295- if i == int ( offlineToRemove ) {
294+ if i == offlineToRemove {
296295 continue
297296 }
298297 newTns = append (newTns , node )
0 commit comments