From bf3b5d6d069a0bbb39af0c487fd597257f862f31 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Tue, 27 Jan 2026 14:45:04 +0100 Subject: [PATCH] test: clarify getCoinbaseRawTx() comparison The code comment mistakingly referred to "the deprecated getCoinbaseTx()", instead of getCoinbaseRawTx. This was missed in d59b4cdb5772917ee13e48552d51662160104b62. Also rename parse_and_deserialize_coinbase_tx to make it more clear it refers to the deprecated method. Finally, this commit drops the getCoinbaseRawTx() call when testing template inspectors. The coinbase input check here is already covered by build_coinbase_test. --- test/functional/interface_ipc.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py index c7183c1bcb4..47589cbcece 100755 --- a/test/functional/interface_ipc.py +++ b/test/functional/interface_ipc.py @@ -144,7 +144,7 @@ class IPCInterfaceTest(BitcoinTestFramework): block.deserialize(block_data) return block - async def parse_and_deserialize_coinbase_tx(self, block_template, ctx): + async def get_coinbase_raw_tx(self, block_template, ctx): assert block_template is not None coinbase_data = BytesIO((await block_template.getCoinbaseRawTx(ctx)).result) tx = CTransaction() @@ -224,8 +224,9 @@ class IPCInterfaceTest(BitcoinTestFramework): coinbase_tx.nLockTime = coinbase_res.lockTime - # Compare to dummy coinbase provided by the deprecated getCoinbaseTx() - coinbase_legacy = await self.parse_and_deserialize_coinbase_tx(template, ctx) + # Compare to dummy coinbase transaction provided by the deprecated + # getCoinbaseRawTx() + coinbase_legacy = await self.get_coinbase_raw_tx(template, ctx) assert_equal(coinbase_legacy.vout[0].nValue, coinbase_res.blockRewardRemaining) # Swap dummy output for our own coinbase_legacy.vout[0].scriptPubKey = coinbase_tx.vout[0].scriptPubKey @@ -282,10 +283,6 @@ class IPCInterfaceTest(BitcoinTestFramework): assert_equal(len(txfees.result), 0) txsigops = await template.getTxSigops(ctx) assert_equal(len(txsigops.result), 0) - coinbase_data = BytesIO((await template.getCoinbaseRawTx(ctx)).result) - coinbase = CTransaction() - coinbase.deserialize(coinbase_data) - assert_equal(coinbase.vin[0].prevout.hash, 0) self.log.debug("Wait for a new template") waitoptions = self.capnp_modules['mining'].BlockWaitOptions()