mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-29 18:20:58 +02:00
test: refactor: remove hex_str_to_bytes
helper
Use the built-in class method bytes.fromhex() instead, which is available since Python 3.0.
This commit is contained in:
@ -41,7 +41,6 @@ from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
create_confirmed_utxos,
|
||||
hex_str_to_bytes,
|
||||
)
|
||||
|
||||
|
||||
@ -204,7 +203,7 @@ class ChainstateWriteCrashTest(BitcoinTestFramework):
|
||||
continue
|
||||
|
||||
for _ in range(3):
|
||||
tx.vout.append(CTxOut(output_amount, hex_str_to_bytes(utxo['scriptPubKey'])))
|
||||
tx.vout.append(CTxOut(output_amount, bytes.fromhex(utxo['scriptPubKey'])))
|
||||
|
||||
# Sign and send the transaction to get into the mempool
|
||||
tx_signed_hex = node.signrawtransactionwithwallet(tx.serialize().hex())['hex']
|
||||
|
Reference in New Issue
Block a user