Skip to content

Commit 5694f1e

Browse files
committed
pytest: test xpay using unannounced channels.
Signed-off-by: Rusty Russell <[email protected]>
1 parent eb2f5f3 commit 5694f1e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/test_xpay.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,3 +530,21 @@ def test_xpay_maxfee(node_factory, bitcoind, chainparams):
530530
ret = l1.rpc.xpay(invstring=inv, maxfee=maxfee)
531531
fee = ret['amount_sent_msat'] - ret['amount_msat']
532532
assert fee <= maxfee
533+
534+
535+
@pytest.mark.xfail(strict=True)
536+
def test_xpay_unannounced(node_factory):
537+
l1, l2 = node_factory.line_graph(2, announce_channels=False)
538+
539+
# BOLT 11, direct peer
540+
b11 = l2.rpc.invoice('10000msat', 'test_xpay_unannounced', 'test_xpay_unannounced bolt11')['bolt11']
541+
ret = l1.rpc.xpay(b11)
542+
assert ret['failed_parts'] == 0
543+
assert ret['successful_parts'] == 1
544+
assert ret['amount_msat'] == 10000
545+
assert ret['amount_sent_msat'] == 10000
546+
547+
# BOLT 12, direct peer
548+
offer = l2.rpc.offer('any')['bolt12']
549+
b12 = l1.rpc.fetchinvoice(offer, '100000msat')['invoice']
550+
l1.rpc.xpay(b12)

0 commit comments

Comments
 (0)