diff --git a/test/functional/feature_taproot.py b/test/functional/feature_taproot.py index 8ac06f570d710..8be2040d9165e 100755 --- a/test/functional/feature_taproot.py +++ b/test/functional/feature_taproot.py @@ -19,6 +19,7 @@ CTxInWitness, CTxOut, SEQUENCE_FINAL, + tx_from_hex, ) from test_framework.script import ( ANNEX_TAG, @@ -109,7 +110,6 @@ program_to_witness, ) from collections import OrderedDict, namedtuple -from io import BytesIO import json import hashlib import os @@ -1386,8 +1386,7 @@ def test_spenders(self, node, spenders, input_counts): # Add change fund_tx.vout.append(CTxOut(balance - 10000, random.choice(host_spks))) # 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 aafee7e87c8ca..23109093d6bad 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 @@ def run_test(self): 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("