test: clarify getCoinbaseRawTx() comparison
What changed, and why it matters
This is a minor cleanup of a Bitcoin Core functional test file. It fixes a misleading code comment, renames a helper function for clarity, and removes a redundant test assertion that was already checked elsewhere. There is no change to production code and no security relevance.
No security action needed. This is a test-only refactor/cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/interface_ipc.py only. It renames parse_and_deserialize_coinbase_tx to get_coinbase_raw_tx, corrects a comment that incorrectly referenced getCoinbaseTx() instead of getCoinbaseRawTx(), and removes a duplicated getCoinbaseRawTx() call plus coinbase input assertion from the template inspector test because build_coinbase_test already covers that check. No consensus, networking, wallet, or RPC code is affected.
Changed components
test/functional/interface_ipc.pyInspect captured patch +4 / −7
diff --git a/test/functional/interface_ipc.py b/test/functional/interface_ipc.py
index c7183c1b..47589cbc 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()
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.