Skip to content

Commit 26359e4

Browse files
pytest: address flakes from blinded paths in bolt12 offers
Following 6e4ff6a, nodes now check for their public address and generate a blinded path for invoices if the address is not advertized. This breaks several of the tests where the blinded path is expected to have the entrypoint be the node itself. Changelog-None
1 parent 8fedb26 commit 26359e4

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

tests/test_pay.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4438,7 +4438,8 @@ def test_fetchinvoice(node_factory, bitcoind):
44384438
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
44394439
opts=[{},
44404440
{},
4441-
{'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'"}])
4441+
{'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'",
4442+
'dev-allow-localhost': None}])
44424443

44434444
# Simple offer first.
44444445
offer1 = l3.rpc.call('offer', {'amount': '2msat',
@@ -4534,6 +4535,7 @@ def test_fetchinvoice(node_factory, bitcoind):
45344535
'description': 'offer3'})
45354536
l4 = node_factory.get_node()
45364537
l4.rpc.connect(l2.info['id'], 'localhost', l2.port)
4538+
time.sleep(0.25)
45374539
# ... even if we can't find ourselves.
45384540
l4.rpc.call('fetchinvoice', {'offer': offer3['bolt12']})
45394541
# ... even if we know it from gossmap
@@ -4585,7 +4587,8 @@ def test_fetchinvoice(node_factory, bitcoind):
45854587

45864588
def test_fetchinvoice_recurrence(node_factory, bitcoind):
45874589
"""Test for our recurrence extension"""
4588-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
4590+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
4591+
opts=[{}, {'dev-allow-localhost': None}, {}])
45894592

45904593
# Recurring offer.
45914594
offer3 = l2.rpc.call('offer', {'amount': '1msat',
@@ -6419,9 +6422,10 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
64196422

64206423
def test_injectpaymentonion_blindedpath(node_factory, executor):
64216424
l1, l2 = node_factory.line_graph(2,
6422-
wait_for_announce=True)
6425+
wait_for_announce=True,
6426+
# avoids trying to create a blinded path to next node
6427+
opts=[{}, {'dev-allow-localhost': None}])
64236428
blockheight = l1.rpc.getinfo()['blockheight']
6424-
64256429
# Test bolt12, with stub blinded path.
64266430
offer = l2.rpc.offer('any')
64276431
inv7 = l1.rpc.fetchinvoice(offer['bolt12'], '1000msat')

tests/test_renepay.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ def test_shadow_routing(node_factory):
5252
Note there is a very low (0.5**10) probability that it fails.
5353
"""
5454
# We need l3 for random walk
55-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
55+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
56+
opts={'dev-allow-localhost': None})
5657

5758
amount = 10000
5859
total_amount = 0
@@ -76,7 +77,7 @@ def test_mpp(node_factory):
7677
Try paying 1.2M sats from 1 to 6.
7778
"""
7879
opts = [
79-
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
80+
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'dev-allow-localhost': None},
8081
]
8182
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
8283
node_factory.join_nodes(
@@ -843,7 +844,8 @@ def test_description(node_factory):
843844

844845

845846
def test_offers(node_factory):
846-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
847+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
848+
opts={'dev-allow-localhost': None})
847849
offer = l3.rpc.offer("1000sat", "test_renepay_offers")['bolt12']
848850
invoice = l1.rpc.fetchinvoice(offer)['invoice']
849851
response = l1.rpc.call("renepay", {"invstring": invoice})

0 commit comments

Comments
 (0)