|
39 | 39 | from test_framework.wallet_util import generate_keypair
|
40 | 40 |
|
41 | 41 | DEFAULT_BYTES_PER_SIGOP = 20 # default setting
|
42 |
| - |
| 42 | +MAX_PUBKEYS_PER_MULTISIG = 20 |
43 | 43 |
|
44 | 44 | class BytesPerSigOpTest(BitcoinTestFramework):
|
45 | 45 | def set_test_params(self):
|
@@ -159,13 +159,13 @@ def create_bare_multisig_tx(utxo_to_spend=None):
|
159 | 159 | # Separately, the parent tx is ok
|
160 | 160 | parent_individual_testres = self.nodes[0].testmempoolaccept([tx_parent.serialize().hex()])[0]
|
161 | 161 | assert parent_individual_testres["allowed"]
|
162 |
| - # Multisig is counted as MAX_PUBKEYS_PER_MULTISIG = 20 sigops |
163 |
| - assert_equal(parent_individual_testres["vsize"], 5000 * 20) |
| 162 | + max_multisig_vsize = MAX_PUBKEYS_PER_MULTISIG * 5000 |
| 163 | + assert_equal(parent_individual_testres["vsize"], max_multisig_vsize) |
164 | 164 |
|
165 | 165 | # But together, it's exceeding limits in the *package* context. If sigops adjusted vsize wasn't being checked
|
166 | 166 | # here, it would get further in validation and give too-long-mempool-chain error instead.
|
167 | 167 | packet_test = self.nodes[0].testmempoolaccept([tx_parent.serialize().hex(), tx_child.serialize().hex()])
|
168 |
| - expected_package_error = f"package-mempool-limits, package size {2*20*5000} exceeds ancestor size limit [limit: 101000]" |
| 168 | + expected_package_error = f"package-mempool-limits, package size {2*max_multisig_vsize} exceeds ancestor size limit [limit: 101000]" |
169 | 169 | assert_equal([x["package-error"] for x in packet_test], [expected_package_error] * 2)
|
170 | 170 |
|
171 | 171 | # When we actually try to submit, the parent makes it into the mempool, but the child would exceed ancestor vsize limits
|
|
0 commit comments