diff options
Diffstat (limited to 'qa/rpc-tests/listtransactions.py')
-rwxr-xr-x | qa/rpc-tests/listtransactions.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/qa/rpc-tests/listtransactions.py b/qa/rpc-tests/listtransactions.py index 8fe72d95d1..0783a1f3d3 100755 --- a/qa/rpc-tests/listtransactions.py +++ b/qa/rpc-tests/listtransactions.py @@ -9,11 +9,10 @@ from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, COIN from io import BytesIO -import binascii def txFromHex(hexstring): tx = CTransaction() - f = BytesIO(binascii.unhexlify(hexstring)) + f = BytesIO(hex_str_to_bytes(hexstring)) tx.deserialize(f) return tx @@ -167,7 +166,7 @@ class ListTransactionsTest(BitcoinTestFramework): tx3 = self.nodes[0].createrawtransaction(inputs, outputs) tx3_modified = txFromHex(tx3) tx3_modified.vin[0].nSequence = 0 - tx3 = binascii.hexlify(tx3_modified.serialize()).decode('utf-8') + tx3 = bytes_to_hex_str(tx3_modified.serialize()) tx3_signed = self.nodes[0].signrawtransaction(tx3)['hex'] txid_3 = self.nodes[0].sendrawtransaction(tx3_signed) @@ -193,7 +192,7 @@ class ListTransactionsTest(BitcoinTestFramework): # Replace tx3, and check that tx4 becomes unknown tx3_b = tx3_modified tx3_b.vout[0].nValue -= int(Decimal("0.004") * COIN) # bump the fee - tx3_b = binascii.hexlify(tx3_b.serialize()).decode('utf-8') + tx3_b = bytes_to_hex_str(tx3_b.serialize()) tx3_b_signed = self.nodes[0].signrawtransaction(tx3_b)['hex'] txid_3b = self.nodes[0].sendrawtransaction(tx3_b_signed, True) assert(is_opt_in(self.nodes[0], txid_3b)) |