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
This commit is contained in:
Alex Myers 2025-02-18 13:30:11 -06:00 committed by Alex Myers
parent 8fedb26e6e
commit 26359e4c8c
2 changed files with 13 additions and 7 deletions

View file

@ -4438,7 +4438,8 @@ def test_fetchinvoice(node_factory, bitcoind):
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
opts=[{},
{},
{'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'"}])
{'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'",
'dev-allow-localhost': None}])
# Simple offer first.
offer1 = l3.rpc.call('offer', {'amount': '2msat',
@ -4534,6 +4535,7 @@ def test_fetchinvoice(node_factory, bitcoind):
'description': 'offer3'})
l4 = node_factory.get_node()
l4.rpc.connect(l2.info['id'], 'localhost', l2.port)
time.sleep(0.25)
# ... even if we can't find ourselves.
l4.rpc.call('fetchinvoice', {'offer': offer3['bolt12']})
# ... even if we know it from gossmap
@ -4585,7 +4587,8 @@ def test_fetchinvoice(node_factory, bitcoind):
def test_fetchinvoice_recurrence(node_factory, bitcoind):
"""Test for our recurrence extension"""
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
opts=[{}, {'dev-allow-localhost': None}, {}])
# Recurring offer.
offer3 = l2.rpc.call('offer', {'amount': '1msat',
@ -6419,9 +6422,10 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
def test_injectpaymentonion_blindedpath(node_factory, executor):
l1, l2 = node_factory.line_graph(2,
wait_for_announce=True)
wait_for_announce=True,
# avoids trying to create a blinded path to next node
opts=[{}, {'dev-allow-localhost': None}])
blockheight = l1.rpc.getinfo()['blockheight']
# Test bolt12, with stub blinded path.
offer = l2.rpc.offer('any')
inv7 = l1.rpc.fetchinvoice(offer['bolt12'], '1000msat')

View file

@ -52,7 +52,8 @@ def test_shadow_routing(node_factory):
Note there is a very low (0.5**10) probability that it fails.
"""
# We need l3 for random walk
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
opts={'dev-allow-localhost': None})
amount = 10000
total_amount = 0
@ -76,7 +77,7 @@ def test_mpp(node_factory):
Try paying 1.2M sats from 1 to 6.
"""
opts = [
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0},
{"disable-mpp": None, "fee-base": 0, "fee-per-satoshi": 0, 'dev-allow-localhost': None},
]
l1, l2, l3, l4, l5, l6 = node_factory.get_nodes(6, opts=opts * 6)
node_factory.join_nodes(
@ -843,7 +844,8 @@ def test_description(node_factory):
def test_offers(node_factory):
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
opts={'dev-allow-localhost': None})
offer = l3.rpc.offer("1000sat", "test_renepay_offers")['bolt12']
invoice = l1.rpc.fetchinvoice(offer)['invoice']
response = l1.rpc.call("renepay", {"invstring": invoice})