|
7 | 7 |
|
8 | 8 | from decimal import Decimal |
9 | 9 | from itertools import product |
| 10 | +from random import randbytes |
10 | 11 |
|
11 | 12 | from test_framework.descriptors import descsum_create |
12 | 13 | from test_framework.key import ECKey |
|
32 | 33 | assert_greater_than, |
33 | 34 | assert_raises_rpc_error, |
34 | 35 | find_output, |
35 | | - random_bytes, |
36 | 36 | ) |
37 | 37 | from test_framework.wallet_util import bytes_to_wif |
38 | 38 |
|
@@ -598,10 +598,10 @@ def test_psbt_input_keys(psbt_input, keys): |
598 | 598 |
|
599 | 599 | self.log.info("Test decoding PSBT with per-input preimage types") |
600 | 600 | # note that the decodepsbt RPC doesn't check whether preimages and hashes match |
601 | | - hash_ripemd160, preimage_ripemd160 = random_bytes(20), random_bytes(50) |
602 | | - hash_sha256, preimage_sha256 = random_bytes(32), random_bytes(50) |
603 | | - hash_hash160, preimage_hash160 = random_bytes(20), random_bytes(50) |
604 | | - hash_hash256, preimage_hash256 = random_bytes(32), random_bytes(50) |
| 601 | + hash_ripemd160, preimage_ripemd160 = randbytes(20), randbytes(50) |
| 602 | + hash_sha256, preimage_sha256 = randbytes(32), randbytes(50) |
| 603 | + hash_hash160, preimage_hash160 = randbytes(20), randbytes(50) |
| 604 | + hash_hash256, preimage_hash256 = randbytes(32), randbytes(50) |
605 | 605 |
|
606 | 606 | tx = CTransaction() |
607 | 607 | tx.vin = [CTxIn(outpoint=COutPoint(hash=int('aa' * 32, 16), n=0), scriptSig=b""), |
|
0 commit comments