v31.1-roots.1 · Commit 2: [PATCH 02/17] feat(policy): preserve Roots parsing and local transaction checks
test/functional/mempool_sigoplimit.py
Before: test/functional/mempool_sigoplimit.py · After: test/functional/mempool_sigoplimit.py
File metadata
index 932e045a81621d89a148912ebba36cebe359e0d2..810ba432c5383fb2535f3ece738578552a4f118c 100755
Download original patch · Release notes
Diff rows 1–31 of 31. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
test/functional/mempool_sigoplimit.py
CHANGED
|
@@ -52,6 +52,7 @@ MAX_PUBKEYS_PER_MULTISIG = 20
|
|
|
52
52
|
class BytesPerSigOpTest(BitcoinTestFramework):
|
|
53
53
|
def set_test_params(self):
|
|
54
54
|
self.num_nodes = 1
|
|
55
|
+
self.extra_args = [['-datacarriersize=100000', '-maxscriptsize=100000', '-acceptnonstddatacarrier=1', '-permitbaredatacarrier=1']]
|
|
55
56
|
|
|
56
57
|
def create_p2wsh_spending_tx(self, witness_script, output_script):
|
|
57
58
|
"""Create a 1-input-1-output P2WSH spending transaction with only the
|
|
@@ -145,7 +146,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
|
145
146
|
self.log.info("Test a overly-large sigops-vbyte hits package limits")
|
|
146
147
|
# Make a 2-transaction package which fails vbyte checks even though
|
|
147
148
|
# separately they would work.
|
|
148
|
-
self.restart_node(0, extra_args=["-bytespersigop=5000","-permitbaremultisig=1"])
|
|
149
|
+
self.restart_node(0, extra_args=self.extra_args[0] + ["-bytespersigop=5000", "-permitbaremultisig=1"])
|
|
149
150
|
|
|
150
151
|
def create_bare_multisig_tx(utxo_to_spend=None):
|
|
151
152
|
_, pubkey = generate_keypair()
|
|
@@ -208,7 +209,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
|
208
209
|
nonstd_tx = CTransaction()
|
|
209
210
|
nonstd_tx.vin = [CTxIn(op, CScript([b"", packed_redeem_script])) for op in outpoints]
|
|
210
211
|
nonstd_tx.vout = [CTxOut(0, CScript([OP_RETURN, b""]))]
|
|
211
|
-
assert_raises_rpc_error(-26, "bad-txns-nonstandard-inputs", self.nodes[0].sendrawtransaction, nonstd_tx.serialize().hex())
|
|
212
|
+
assert_raises_rpc_error(-26, "bad-txns-input-sigops-toomany-overall", self.nodes[0].sendrawtransaction, nonstd_tx.serialize().hex())
|
|
212
213
|
|
|
213
214
|
# Spending one less accounts for 2490 legacy sigops and is standard.
|
|
214
215
|
std_tx = deepcopy(nonstd_tx)
|
|
@@ -227,7 +228,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
|
227
228
|
else:
|
|
228
229
|
bytespersigop_parameter = f"-bytespersigop={bytes_per_sigop}"
|
|
229
230
|
self.log.info(f"Test sigops limit setting {bytespersigop_parameter}...")
|
|
230
|
-
self.restart_node(0, extra_args=[bytespersigop_parameter])
|
|
231
|
+
self.restart_node(0, extra_args=self.extra_args[0] + [bytespersigop_parameter])
|
|
231
232
|
|
|
232
233
|
for num_sigops in (69, 101, 142, 183, 222):
|
|
233
234
|
self.test_sigops_limit(bytes_per_sigop, num_sigops)
|