test: clarify getCoinbaseRawTx() comparison

The code comment mistakingly referred to "the deprecated getCoinbaseTx()",
instead of getCoinbaseRawTx. This was missed in d59b4cdb57.

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.
This commit is contained in:
Sjors Provoost
2026-01-27 14:45:04 +01:00
parent 78df9003d6
commit bf3b5d6d06

View File

@@ -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()