MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_xpay_zeroconf

Function test_xpay_zeroconf

tests/test_xpay.py:589–613  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

587
588
589def 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
616def test_xpay_no_mpp(node_factory, chainparams):

Callers

nothing calls this directly

Calls 10

wait_forFunction · 0.90
get_nodesMethod · 0.80
fundwalletMethod · 0.80
listpeerchannelsMethod · 0.80
fetchinvoiceMethod · 0.80
connectMethod · 0.45
fundchannelMethod · 0.45
invoiceMethod · 0.45
xpayMethod · 0.45
offerMethod · 0.45

Tested by

no test coverage detected