Skip to content

Commit f0524cd

Browse files
committed
functional test: correctly detect nonstd TRUC tx vsize in feature_taproot
1 parent a92e8b1 commit f0524cd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/functional/feature_taproot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ def byte_popper(expr):
644644

645645
TX_MAX_STANDARD_VERSION = 3
646646
TX_STANDARD_VERSIONS = [1, 2, TX_MAX_STANDARD_VERSION]
647+
TRUC_MAX_VSIZE = 10000 # test doesn't cover in-mempool spends, so only this limit is hit
647648

648649
# === Actual test cases ===
649650

@@ -1538,7 +1539,9 @@ def test_spenders(self, node, spenders, input_counts):
15381539
is_standard_tx = (
15391540
fail_input is None # Must be valid to be standard
15401541
and (all(utxo.spender.is_standard for utxo in input_utxos)) # All inputs must be standard
1541-
and tx.version in TX_STANDARD_VERSIONS) # The tx version must be standard
1542+
and tx.version in TX_STANDARD_VERSIONS # The tx version must be standard
1543+
and not (tx.version == 3 and tx.get_vsize() > TRUC_MAX_VSIZE) # Topological standardness rules must be followed
1544+
)
15421545
msg = ','.join(utxo.spender.comment + ("*" if n == fail_input else "") for n, utxo in enumerate(input_utxos))
15431546
if is_standard_tx:
15441547
node.sendrawtransaction(tx.serialize().hex(), 0)

0 commit comments

Comments
 (0)