test: Read debug log for self-checking comment

The DataStream comment was a bit stale, because it was using
CDataStream.

Fix it by using assert_debug_log for a self-documenting and
self-checking test code.
This commit is contained in:
MarcoFalke
2026-02-02 16:35:08 +01:00
parent 9f8764c814
commit fa879db735

View File

@@ -1198,8 +1198,8 @@ class SegWitTest(BitcoinTestFramework):
block.vtx = [block.vtx[0]]
self.update_witness_block_with_transactions(block, [tx2])
# This block doesn't result in a specific reject reason, but an iostream exception:
# "Exception 'CDataStream::read(): end of data: unspecified iostream_category error' (...) caught"
test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
with self.nodes[0].assert_debug_log(["Exception 'DataStream::read(): end of data"]):
test_witness_block(self.nodes[0], self.test_node, block, accepted=False)
# Now make one of the intermediate witnesses be incorrect
tx2.wit.vtxinwit.append(CTxInWitness())