(node_factory)
| 587 | |
| 588 | |
| 589 | def test_xpay_zeroconf(node_factory): |
| 590 | zeroconf_plugin = Path(__file__).parent / "plugins" / "zeroconf-selective.py" |
| 591 | l1, l2 = node_factory.get_nodes(2, |
| 592 | opts=[{}, |
| 593 | {'plugin': zeroconf_plugin, |
| 594 | 'zeroconf_allow': 'any'}]) |
| 595 | |
| 596 | l1.fundwallet(FUNDAMOUNT * 2) |
| 597 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 598 | l1.rpc.fundchannel(l2.info['id'], amount=FUNDAMOUNT, announce=False, mindepth=0) |
| 599 | |
| 600 | wait_for(lambda: all([c['state'] == 'CHANNELD_NORMAL' for c in l1.rpc.listpeerchannels()['channels'] + l2.rpc.listpeerchannels()['channels']])) |
| 601 | |
| 602 | # BOLT-11, direct peer |
| 603 | b11 = l2.rpc.invoice('10000msat', 'test_xpay_unannounced', 'test_xpay_unannounced bolt11')['bolt11'] |
| 604 | ret = l1.rpc.xpay(b11) |
| 605 | assert ret['failed_parts'] == 0 |
| 606 | assert ret['successful_parts'] == 1 |
| 607 | assert ret['amount_msat'] == 10000 |
| 608 | assert ret['amount_sent_msat'] == 10000 |
| 609 | |
| 610 | # BOLT-12, direct peer |
| 611 | offer = l2.rpc.offer('any')['bolt12'] |
| 612 | b12 = l1.rpc.fetchinvoice(offer, '100000msat')['invoice'] |
| 613 | l1.rpc.xpay(b12) |
| 614 | |
| 615 | |
| 616 | def test_xpay_no_mpp(node_factory, chainparams): |
nothing calls this directly
no test coverage detected