diff --git a/XDCxlending/lendingstate/lendingitem_test.go b/XDCxlending/lendingstate/lendingitem_test.go index fda2303510..243dc9d583 100644 --- a/XDCxlending/lendingstate/lendingitem_test.go +++ b/XDCxlending/lendingstate/lendingitem_test.go @@ -3,7 +3,6 @@ package lendingstate import ( "fmt" "math/big" - "math/rand" "os" "testing" "time" @@ -521,7 +520,6 @@ func sendOrder(nonce uint64) { os.Exit(1) } defer rpcClient.Close() - rand.Seed(time.Now().UTC().UnixNano()) item := &LendingOrderMsg{ AccountNonce: nonce, Quantity: EtherToWei(big.NewInt(1000)), diff --git a/contracts/blocksigner/blocksigner_test.go b/contracts/blocksigner/blocksigner_test.go index d4e1bcc394..a9ed2ef26b 100644 --- a/contracts/blocksigner/blocksigner_test.go +++ b/contracts/blocksigner/blocksigner_test.go @@ -81,7 +81,6 @@ func randomHash() common.Hash { letterBytes := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789" var b common.Hash for i := range b { - rand.Seed(time.Now().UnixNano()) b[i] = letterBytes[rand.Intn(len(letterBytes))] } return b diff --git a/contracts/utils_test.go b/contracts/utils_test.go index b05fccd0ea..1749c8ff80 100644 --- a/contracts/utils_test.go +++ b/contracts/utils_test.go @@ -22,7 +22,6 @@ import ( "math/big" "math/rand" "testing" - "time" "github.com/XinFinOrg/XDPoSChain/accounts/abi/bind" "github.com/XinFinOrg/XDPoSChain/accounts/abi/bind/backends" @@ -121,7 +120,6 @@ func randomHash() common.Hash { letterBytes := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789" var b common.Hash for i := range b { - rand.Seed(time.Now().UnixNano()) b[i] = letterBytes[rand.Intn(len(letterBytes))] } return b @@ -170,7 +168,6 @@ func isArrayEqual(a [][]int64, b [][]int64) bool { func TestGenM2FromRandomize(t *testing.T) { var a []int64 for i := 0; i <= 10; i++ { - rand.Seed(time.Now().UTC().UnixNano()) a = append(a, int64(rand.Intn(9999))) } b, err := GenM2FromRandomize(a, common.MaxMasternodes) diff --git a/contracts/validator/validator_test.go b/contracts/validator/validator_test.go index 428691b5f3..a52bae3f98 100644 --- a/contracts/validator/validator_test.go +++ b/contracts/validator/validator_test.go @@ -131,7 +131,6 @@ func TestRewardBalance(t *testing.T) { } logCaps := make(map[int]*logCap) for i := 0; i <= 10; i++ { - rand.Seed(time.Now().UTC().UnixNano()) randIndex := rand.Intn(len(accounts)) randCap := rand.Intn(10) * 1000 if randCap <= 0 { diff --git a/event/event_test.go b/event/event_test.go index a26fdabf62..5a06545638 100644 --- a/event/event_test.go +++ b/event/event_test.go @@ -100,7 +100,6 @@ func TestSubscribeDuplicateType(t *testing.T) { } func TestMuxConcurrent(t *testing.T) { - rand.Seed(time.Now().Unix()) mux := new(TypeMux) defer mux.Stop() diff --git a/p2p/discover/udp_test.go b/p2p/discover/udp_test.go index 040b177c20..7ec99cc422 100644 --- a/p2p/discover/udp_test.go +++ b/p2p/discover/udp_test.go @@ -147,7 +147,6 @@ func TestUDP_responseTimeouts(t *testing.T) { test := newUDPTest(t) defer test.table.Close() - rand.Seed(time.Now().UnixNano()) randomDuration := func(max time.Duration) time.Duration { return time.Duration(rand.Int63n(int64(max))) }