From 284c41012c5d737e34e93bfbe283fb7c50bce793 Mon Sep 17 00:00:00 2001 From: simlecode <69969590+simlecode@users.noreply.github.com> Date: Mon, 20 Nov 2023 14:46:58 +0800 Subject: [PATCH] fix: use new rand --- pkg/messagepool/block_proba_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/messagepool/block_proba_test.go b/pkg/messagepool/block_proba_test.go index 540bc0fea3..c341c661a3 100644 --- a/pkg/messagepool/block_proba_test.go +++ b/pkg/messagepool/block_proba_test.go @@ -26,12 +26,12 @@ func TestBlockProbability(t *testing.T) { func TestWinnerProba(t *testing.T) { tf.UnitTest(t) - rand.New(rand.NewSource(time.Now().UnixNano())) + r := rand.New(rand.NewSource(time.Now().UnixNano())) const N = 1000000 winnerProba := noWinnersProb() sum := 0 for i := 0; i < N; i++ { - minersRand := rand.Float64() + minersRand := r.Float64() j := 0 for ; j < MaxBlocks; j++ { minersRand -= winnerProba[j]