v30.3-roots.1 · Commit 3: [PATCH 03/68] feat(policy): preserve Roots relay and network controls on Core 30.3
test/functional/mempool_sigoplimit.py
Before: test/functional/mempool_sigoplimit.py · After: test/functional/mempool_sigoplimit.py
File metadata
index 6b2a0268c4dadd2a0b8d6e036eba80460e59f91b..41e06bdabfbc71926d8db68b89d097b75d12d0a3 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
|
@@ -52,6 +52,8 @@ MAX_PUBKEYS_PER_MULTISIG = 20
|
|
| 52 |
class BytesPerSigOpTest(BitcoinTestFramework):
|
| 53 |
def set_test_params(self):
|
| 54 |
self.num_nodes = 1
|
|
|
|
|
|
|
| 55 |
|
| 56 |
def create_p2wsh_spending_tx(self, witness_script, output_script):
|
| 57 |
"""Create a 1-input-1-output P2WSH spending transaction with only the
|
|
@@ -185,8 +187,8 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
| 185 |
def test_legacy_sigops_stdness(self):
|
| 186 |
self.log.info("Test a transaction with too many legacy sigops in its inputs is non-standard.")
|
| 187 |
|
| 188 |
-
# Restart with the default settings
|
| 189 |
-
self.restart_node(0)
|
| 190 |
|
| 191 |
# Create a P2SH script with 15 sigops.
|
| 192 |
_, dummy_pubkey = generate_keypair()
|
|
@@ -208,7 +210,7 @@ class BytesPerSigOpTest(BitcoinTestFramework):
|
|
| 208 |
nonstd_tx = CTransaction()
|
| 209 |
nonstd_tx.vin = [CTxIn(op, CScript([b"", packed_redeem_script])) for op in outpoints]
|
| 210 |
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 |
|
| 213 |
# Spending one less accounts for 2490 legacy sigops and is standard.
|
| 214 |
std_tx = deepcopy(nonstd_tx)
|
|
|
|
| 52 |
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', '-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)
|