aboutsummaryrefslogtreecommitdiff
path: root/test/functional/rpc_signrawtransaction.py
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-07-31 21:23:16 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-08-01 19:26:51 +0200
commitca6c154ef116e8d2e0484cdb1af13b34a0c86c17 (patch)
tree4b38a878a5b2fd0f49a2cc0b0e1948b8119b40e9 /test/functional/rpc_signrawtransaction.py
parentf2e41d11097dde1c841bcaa8615886c984f71632 (diff)
downloadbitcoin-ca6c154ef116e8d2e0484cdb1af13b34a0c86c17.tar.xz
test: refactor: remove `hex_str_to_bytes` helper
Use the built-in class method bytes.fromhex() instead, which is available since Python 3.0.
Diffstat (limited to 'test/functional/rpc_signrawtransaction.py')
-rwxr-xr-xtest/functional/rpc_signrawtransaction.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py
index 571029155e..312a4abbc3 100755
--- a/test/functional/rpc_signrawtransaction.py
+++ b/test/functional/rpc_signrawtransaction.py
@@ -20,7 +20,6 @@ from test_framework.util import (
assert_raises_rpc_error,
find_vout_for_address,
generate_to_height,
- hex_str_to_bytes,
)
from test_framework.messages import (
CTxInWitness,
@@ -233,7 +232,7 @@ class SignRawTransactionsTest(BitcoinTestFramework):
embedded_pubkey = eckey.get_pubkey().get_bytes().hex()
witness_script = {
'P2PKH': key_to_p2pkh_script(embedded_pubkey).hex(),
- 'P2PK': CScript([hex_str_to_bytes(embedded_pubkey), OP_CHECKSIG]).hex()
+ 'P2PK': CScript([bytes.fromhex(embedded_pubkey), OP_CHECKSIG]).hex()
}.get(tx_type, "Invalid tx_type")
redeem_script = script_to_p2wsh_script(witness_script).hex()
addr = script_to_p2sh(redeem_script)