Skip to content

Commit 094701a

Browse files
committed
squash! test: Skip test_segwit_versions subtest (conflicts with DEPLOYMENT_REDUCED_DATA); adapt 6 tests to NODE_BIP148 service flag; add assert_equal_without_usage helper for testmempoolaccept results
1 parent e7f3b9f commit 094701a

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

test/functional/p2p_segwit.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,12 +1331,6 @@ def test_segwit_versions(self):
13311331
Sending to future segwit versions is always allowed.
13321332
Can run this before and after segwit activation."""
13331333

1334-
# SKIP: This test expects upgradable witness versions (OP_1 through OP_16) to be accepted.
1335-
# With DEPLOYMENT_REDUCED_DATA active, SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM
1336-
# is enforced, which intentionally rejects these transactions to prevent data bloat.
1337-
self.log.info("Skipping segwit versions test - upgradable witness programs rejected by DEPLOYMENT_REDUCED_DATA")
1338-
return
1339-
13401334
NUM_SEGWIT_VERSIONS = 17 # will test OP_0, OP1, ..., OP_16
13411335
if len(self.utxo) < NUM_SEGWIT_VERSIONS:
13421336
tx = CTransaction()
@@ -1361,8 +1355,9 @@ def test_segwit_versions(self):
13611355
for version in list(range(OP_1, OP_16 + 1)) + [OP_0]:
13621356
# First try to spend to a future version segwit script_pubkey.
13631357
if version == OP_1:
1364-
# Don't use 32-byte v1 witness (used by Taproot; see BIP 341)
1365-
script_pubkey = CScript([CScriptOp(version), witness_hash + b'\x00'])
1358+
# Use 20-byte program to avoid Taproot (32-byte) and stay under
1359+
# REDUCED_DATA's 34-byte output limit (33-byte program would be 35 bytes total)
1360+
script_pubkey = CScript([CScriptOp(version), witness_hash[:20]])
13661361
else:
13671362
script_pubkey = CScript([CScriptOp(version), witness_hash])
13681363
tx.vin = [CTxIn(COutPoint(self.utxo[0].sha256, self.utxo[0].n), b"")]

0 commit comments

Comments
 (0)