Skip to content

Commit f319287

Browse files
committed
test: assert serialized txouts size of gen_return_txouts helper
This assures that changing the internals of the helper function still leads to the expected outcome sizewise (preparation for the next commit).
1 parent cc22bd7 commit f319287

File tree

1 file changed

+3
-1
lines changed
  • test/functional/test_framework

1 file changed

+3
-1
lines changed

test/functional/test_framework/util.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,8 @@ def chain_transaction(node, parent_txids, vouts, value, fee, num_outputs):
499499

500500

501501
# Create large OP_RETURN txouts that can be appended to a transaction
502-
# to make it large (helper for constructing large transactions).
502+
# to make it large (helper for constructing large transactions). The
503+
# total serialized size of the txouts is about 66k vbytes.
503504
def gen_return_txouts():
504505
# Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create
505506
# So we have big transactions (and therefore can't fit very many into each block)
@@ -515,6 +516,7 @@ def gen_return_txouts():
515516
txout.scriptPubKey = bytes.fromhex(script_pubkey)
516517
for _ in range(128):
517518
txouts.append(txout)
519+
assert_equal(sum([len(txout.serialize()) for txout in txouts]), 67456)
518520
return txouts
519521

520522

0 commit comments

Comments
 (0)