v29.4-roots.3 · Commit 3: [PATCH 03/30] policy: restore conservative relay and network controls
test/functional/mempool_sigoplimit.py
Before: test/functional/mempool_sigoplimit.py · After: test/functional/mempool_sigoplimit.py
File metadata
index ec491ced23075d231cd8b39cbd0b941cf719bb41..51ae5b0a6da2669c27f2a4cdfb4b9e0b55177016 100755
Download original patch · Release notes
Diff rows 1–26 of 26. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. Before is on the left; after is on the right. Unified view fits narrow screens more easily.
test/functional/mempool_sigoplimit.py
CHANGED
|
@@ -53,7 +53,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
| 53 |
def set_test_params(self):
|
| 54 |
self.num_nodes = 1
|
| 55 |
# allow large datacarrier output to pad transactions
|
| 56 |
-
self.extra_args = [['-datacarriersize=100000']]
|
| 57 |
|
| 58 |
def create_p2wsh_spending_tx(self, witness_script, output_script):
|
| 59 |
"""Create a 1-input-1-output P2WSH spending transaction with only the
|
|
@@ -187,8 +187,8 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
| 187 |
def test_legacy_sigops_stdness(self):
|
| 188 |
self.log.info("Test a transaction with too many legacy sigops in its inputs is non-standard.")
|
| 189 |
|
| 190 |
-
# Restart with the default settings
|
| 191 |
-
self.restart_node(0)
|
| 192 |
|
| 193 |
# Create a P2SH script with 15 sigops.
|
| 194 |
_, dummy_pubkey = generate_keypair()
|
|
@@ -210,7 +210,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
| 210 |
nonstd_tx = CTransaction()
|
| 211 |
nonstd_tx.vin = [CTxIn(op, CScript([b"", packed_redeem_script])) for op in outpoints]
|
| 212 |
nonstd_tx.vout = [CTxOut(0, CScript([OP_RETURN, b""]))]
|
| 213 |
-
assert_raises_rpc_error(-26, "bad-txns-nonstandard-inputs", self.nodes[0].sendrawtransaction, nonstd_tx.serialize().hex())
|
| 214 |
|
| 215 |
# Spending one less accounts for 2490 legacy sigops and is standard.
|
| 216 |
std_tx = deepcopy(nonstd_tx)
|
|
|
|
| 53 |
def set_test_params(self):
|
| 54 |
self.num_nodes = 1
|
| 55 |
# allow large datacarrier output to pad transactions
|
| 56 |
+
self.extra_args = [['-datacarriersize=100000', '-datacarriercost=0.25', '-maxscriptsize=100000', '-acceptnonstddatacarrier=1', '-permitbaredatacarrier=1']]
|
| 57 |
|
| 58 |
def create_p2wsh_spending_tx(self, witness_script, output_script):
|
| 59 |
"""Create a 1-input-1-output P2WSH spending transaction with only the
|
|
|
|
| 187 |
def test_legacy_sigops_stdness(self):
|
| 188 |
self.log.info("Test a transaction with too many legacy sigops in its inputs is non-standard.")
|
| 189 |
|
| 190 |
+
# Restart with the legacy sigop limit under test.
|
| 191 |
+
self.restart_node(0, extra_args=self.extra_args[0] + [f"-maxtxlegacysigops={MAX_STD_LEGACY_SIGOPS}"])
|
| 192 |
|
| 193 |
# Create a P2SH script with 15 sigops.
|
| 194 |
_, dummy_pubkey = generate_keypair()
|
|
|
|
| 210 |
nonstd_tx = CTransaction()
|
| 211 |
nonstd_tx.vin = [CTxIn(op, CScript([b"", packed_redeem_script])) for op in outpoints]
|
| 212 |
nonstd_tx.vout = [CTxOut(0, CScript([OP_RETURN, b""]))]
|
| 213 |
+
assert_raises_rpc_error(-26, "bad-txns-input-sigops-toomany-overall", self.nodes[0].sendrawtransaction, nonstd_tx.serialize().hex())
|
| 214 |
|
| 215 |
# Spending one less accounts for 2490 legacy sigops and is standard.
|
| 216 |
std_tx = deepcopy(nonstd_tx)
|