mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-12 19:42:31 +02:00
Merge bitcoin/bitcoin#28727: test: replace random_bytes with random.randbytes
fe3ac3700d
test: replace random_bytes with randbytes #28720 (ns-xvrn) Pull request description: With Python upgraded to 3.9 replaced the `random_bytes` function in util of functional tests and replaced it's usage with `random.randbytes`. Closes #28720. ACKs for top commit: maflcko: lgtm ACKfe3ac3700d
BrandonOdiwuor: ACKfe3ac3700d
stickies-v: ACKfe3ac3700d
, thanks for picking this up kristapsk: utACKfe3ac3700d
Tree-SHA512: f65a75e73ebd840c2936eb133d42bccd552f25b717c8ca25c18d06e0593e12f292389cfcc0a0b0759004b67a46ea0c8ac237973ef90f246139778230be1e64e1
This commit is contained in:
@ -13,7 +13,6 @@ import json
|
||||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import random
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
@ -287,12 +286,6 @@ def sha256sum_file(filename):
|
||||
return h.digest()
|
||||
|
||||
|
||||
# TODO: Remove and use random.randbytes(n) directly
|
||||
def random_bytes(n):
|
||||
"""Return a random bytes object of length n."""
|
||||
return random.randbytes(n)
|
||||
|
||||
|
||||
# RPC/P2P connection constants and functions
|
||||
############################################
|
||||
|
||||
|
Reference in New Issue
Block a user