diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py index d65ec4abc6..ffee6d35a6 100755 --- a/test/functional/feature_taproot.py +++ b/test/functional/feature_taproot.py @@ -23,6 +23,7 @@ from test_framework.messages import ( ser_uint256, uint256_from_str, SEQUENCE_FINAL, + tx_from_hex, ) from test_framework.script import ( ANNEX_TAG, @@ -115,7 +116,6 @@ from test_framework.address import ( # program_to_witness, ) from collections import OrderedDict, namedtuple -from io import BytesIO import json import hashlib import os @@ -1437,8 +1437,7 @@ class TaprootTest(BitcoinTestFramework): fund_tx.vout.append(CTxOut(10000)) # ELEMENTS: and fee fund_tx.wit.vtxoutwit.append(CTxOutWitness()) # Ask the wallet to sign - ss = BytesIO(bytes.fromhex(node.signrawtransactionwithwallet(fund_tx.serialize().hex())["hex"])) - fund_tx.deserialize(ss) + fund_tx = tx_from_hex(node.signrawtransactionwithwallet(fund_tx.serialize().hex())["hex"]) # Construct UTXOData entries fund_tx.rehash() for i in range(count_this_tx): diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index 22cce61cf6..6eee01acd7 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -7,9 +7,7 @@ from decimal import Decimal from enum import Enum import http.client -from io import BytesIO import json -from struct import pack, unpack import typing import urllib.parse @@ -160,12 +158,11 @@ class RESTTest (BitcoinTestFramework): bin_request = b'\x01\x02' for txid, n in [spending, spent]: bin_request += bytes.fromhex(txid) - bin_request += pack("i", n) + bin_request += n.to_bytes(4, 'little') bin_response = self.test_rest_request("/getutxos", http_method='POST', req_type=ReqType.BIN, body=bin_request, ret_type=RetType.BYTES) - output = BytesIO(bin_response) - chain_height, = unpack("