diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-29 17:42:51 +0200 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2022-06-29 17:42:51 +0200 |
commit | b1ba3ed155e89fb6e30237cba8bc8028c7906830 (patch) | |
tree | 5ddf936826cb045c48df7ccad968779a85c032e9 /test/functional/test_framework | |
parent | f319287d819cc97b5422248aacf447ca190e20f6 (diff) | |
download | bitcoin-b1ba3ed155e89fb6e30237cba8bc8028c7906830.tar.xz |
test: let `gen_return_txouts` create a single large OP_RETURN output
Transactions with more than one datacarrier (OP_RETURN) output
are never considered standard, i.e. this change is necessary in
order to to get rid of the `acceptnonstdtxn` option for some
tests.
Diffstat (limited to 'test/functional/test_framework')
-rw-r--r-- | test/functional/test_framework/util.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index eab94c32d9..1ee23f7574 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -502,20 +502,9 @@ def chain_transaction(node, parent_txids, vouts, value, fee, num_outputs): # 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) - # create one script_pubkey - script_pubkey = "6a4d0200" # OP_RETURN OP_PUSH2 512 bytes - for _ in range(512): - script_pubkey = script_pubkey + "01" - # concatenate 128 txouts of above script_pubkey which we'll insert before the txout for change - txouts = [] from .messages import CTxOut - txout = CTxOut() - txout.nValue = 0 - txout.scriptPubKey = bytes.fromhex(script_pubkey) - for _ in range(128): - txouts.append(txout) + from .script import CScript, OP_RETURN + txouts = [CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN, b'\x01'*67437]))] assert_equal(sum([len(txout.serialize()) for txout in txouts]), 67456) return txouts |