(node_factory, chainparams)
| 568 | |
| 569 | @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', 'must be on bitcoin network') |
| 570 | def test_p2tr_funding(node_factory, chainparams): |
| 571 | # Don't get any funds from previous runs. |
| 572 | l1, l2 = node_factory.line_graph(2, opts={'random_hsm': True}, fundchannel=False) |
| 573 | |
| 574 | # fund a p2tr address and then open a channel with it |
| 575 | res = l1.openchannel(l2, 25000, 'p2tr') |
| 576 | address = res['address'] |
| 577 | assert address.startswith(chainparams['bip173_prefix']) |
| 578 | |
| 579 | # probably overly paranoid checking |
| 580 | wallettxid = res['wallettxid'] |
| 581 | |
| 582 | wallettx = l1.bitcoin.rpc.getrawtransaction(wallettxid, True) |
| 583 | fundingtx = l1.bitcoin.rpc.decoderawtransaction(res['fundingtx']) |
| 584 | |
| 585 | def is_p2tr(output): |
| 586 | return output['type'] == 'witness_v1_taproot' and \ |
| 587 | address == scriptpubkey_addr(output) |
| 588 | |
| 589 | assert any(is_p2tr(output['scriptPubKey']) for output in wallettx['vout']) |
| 590 | assert only_one(fundingtx['vin'])['txid'] == res['wallettxid'] |
| 591 | |
| 592 | |
| 593 | @unittest.skipIf(TEST_NETWORK == 'liquid-regtest', "P2TR not yet supported on Elements") |
nothing calls this directly
no test coverage detected