From a79396fe5f8f81c78cf84117a87074c6ff6c9d95 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 16 Jun 2021 00:32:18 +0200 Subject: test: remove `ToHex` helper, use .serialize().hex() instead --- test/functional/feature_segwit.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'test/functional/feature_segwit.py') diff --git a/test/functional/feature_segwit.py b/test/functional/feature_segwit.py index 0f62701305..42910904d7 100755 --- a/test/functional/feature_segwit.py +++ b/test/functional/feature_segwit.py @@ -23,7 +23,6 @@ from test_framework.messages import ( CTransaction, CTxIn, CTxOut, - ToHex, sha256, tx_from_hex, ) @@ -268,7 +267,7 @@ class SegWitTest(BitcoinTestFramework): tx = CTransaction() tx.vin.append(CTxIn(COutPoint(int(txid1, 16), 0), b'')) tx.vout.append(CTxOut(int(49.99 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))) - tx2_hex = self.nodes[0].signrawtransactionwithwallet(ToHex(tx))['hex'] + tx2_hex = self.nodes[0].signrawtransactionwithwallet(tx.serialize().hex())['hex'] txid2 = self.nodes[0].sendrawtransaction(tx2_hex) tx = tx_from_hex(tx2_hex) assert not tx.wit.is_null() @@ -285,7 +284,7 @@ class SegWitTest(BitcoinTestFramework): tx.vin.append(CTxIn(COutPoint(int(txid2, 16), 0), b"")) tx.vout.append(CTxOut(int(49.95 * COIN), CScript([OP_TRUE, OP_DROP] * 15 + [OP_TRUE]))) # Huge fee tx.calc_sha256() - txid3 = self.nodes[0].sendrawtransaction(hexstring=ToHex(tx), maxfeerate=0) + txid3 = self.nodes[0].sendrawtransaction(hexstring=tx.serialize().hex(), maxfeerate=0) assert tx.wit.is_null() assert txid3 in self.nodes[0].getrawmempool() -- cgit v1.2.3