From 6ccbf982920f320d79ae50579cb0db82ec456b3b Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Thu, 11 Dec 2025 18:49:20 +0800 Subject: [PATCH] core/txpool: remove deprecated uses of math.rand #26710 (#1843) --- core/txpool/txpool_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/txpool/txpool_test.go b/core/txpool/txpool_test.go index 8d53a025f7..7cba9ebf58 100644 --- a/core/txpool/txpool_test.go +++ b/core/txpool/txpool_test.go @@ -18,6 +18,7 @@ package txpool import ( "crypto/ecdsa" + crand "crypto/rand" "errors" "fmt" "math" @@ -112,7 +113,7 @@ func pricedTransaction(nonce uint64, gaslimit uint64, gasprice *big.Int, key *ec func pricedDataTransaction(nonce uint64, gaslimit uint64, gasprice *big.Int, key *ecdsa.PrivateKey, bytes uint64) *types.Transaction { data := make([]byte, bytes) - rand.Read(data) + crand.Read(data) tx, _ := types.SignTx(types.NewTransaction(nonce, common.Address{}, big.NewInt(0), gaslimit, gasprice, data), types.HomesteadSigner{}, key) return tx