mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-09 12:12:41 +01: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:
@@ -10,7 +10,6 @@ from test_framework.messages import (
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import (
|
||||
assert_equal,
|
||||
hex_str_to_bytes
|
||||
)
|
||||
|
||||
|
||||
@@ -36,7 +35,7 @@ class AddressesDeprecationTest(BitcoinTestFramework):
|
||||
|
||||
# This transaction is derived from test/util/data/txcreatemultisig1.json
|
||||
tx = tx_from_hex(signed)
|
||||
tx.vout[0].scriptPubKey = hex_str_to_bytes("522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae")
|
||||
tx.vout[0].scriptPubKey = bytes.fromhex("522102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff39721021ac43c7ff740014c3b33737ede99c967e4764553d1b2b83db77c83b8715fa72d2102df2089105c77f266fa11a9d33f05c735234075f2e8780824c6b709415f9fb48553ae")
|
||||
tx_signed = node.signrawtransactionwithwallet(tx.serialize().hex())['hex']
|
||||
txid = node.sendrawtransaction(hexstring=tx_signed, maxfeerate=0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user