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:
1 parent
f2e41d1109
commit
ca6c154ef1
15 files changed
+40
-57
No files matched your search
@@ -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