diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-29 17:28:33 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-29 17:28:33 +0200 |
commit | f319287d819cc97b5422248aacf447ca190e20f6 (patch) | |
tree | 33fb7a06a9559c04c8e485b4159f4fc23c744475 /test/functional | |
parent | cc22bd7f708fc3f5e793bf0138cd340f71c0feb9 (diff) |
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).
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/test_framework/util.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 6a588275ea..eab94c32d9 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -499,7 +499,8 @@ def chain_transaction(node, parent_txids, vouts, value, fee, num_outputs): # Create large OP_RETURN txouts that can be appended to a transaction -# to make it large (helper for constructing large transactions). +# to make it large (helper for constructing large transactions). The +# total serialized size of the txouts is about 66k vbytes. def gen_return_txouts(): # Some pre-processing to create a bunch of OP_RETURN txouts to insert into transactions we create # So we have big transactions (and therefore can't fit very many into each block) @@ -515,6 +516,7 @@ def gen_return_txouts(): txout.scriptPubKey = bytes.fromhex(script_pubkey) for _ in range(128): txouts.append(txout) + assert_equal(sum([len(txout.serialize()) for txout in txouts]), 67456) return txouts |