Skip to content

Commit 24fb948

Browse files
committed
test: functional test for bip349
1 parent 3dc3325 commit 24fb948

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

test/functional/feature_taproot.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
OP_EQUAL,
6666
OP_EQUALVERIFY,
6767
OP_IF,
68+
OP_INTERNALKEY,
6869
OP_NOP,
6970
OP_NOT,
7071
OP_NOTIF,
@@ -660,6 +661,22 @@ def byte_popper(expr):
660661

661662
# === Actual test cases ===
662663

664+
def spenders_internalkey_active():
665+
666+
secs = [generate_privkey() for _ in range(8)]
667+
pubs = [compute_xonly_pubkey(sec)[0] for sec in secs]
668+
669+
spenders = []
670+
671+
scripts = [
672+
("ik", CScript([OP_INTERNALKEY, OP_EQUAL])),
673+
]
674+
675+
tap = taproot_construct(pubs[0], scripts)
676+
677+
add_spender(spenders, "ik/success", tap=tap, leaf="ik", inputs=[pubs[0]], failure={"inputs": [pubs[1]]})
678+
679+
return spenders
663680

664681
def spenders_taproot_active():
665682
"""Return a list of Spenders for testing post-Taproot activation behavior."""
@@ -1783,7 +1800,7 @@ def run_test(self):
17831800
self.gen_test_vectors()
17841801

17851802
self.log.info("Post-activation tests...")
1786-
self.test_spenders(self.nodes[0], spenders_taproot_active(), input_counts=[1, 2, 2, 2, 2, 3])
1803+
self.test_spenders(self.nodes[0], spenders_taproot_active() + spenders_internalkey_active(), input_counts=[1, 2, 2, 2, 2, 3])
17871804
# Run each test twice; once in isolation, and once combined with others. Testing in isolation
17881805
# means that the standardness is verified in every test (as combined transactions are only standard
17891806
# when all their inputs are standard).

0 commit comments

Comments
 (0)