Skip to content

Commit 0cc52bc

Browse files
rustyrussellvincenzopalazzo
authored andcommitted
pytest: don't set experimental-offers in tests: it's the default now.
And about to be deprecated. Signed-off-by: Rusty Russell <[email protected]>
1 parent 46b0eb1 commit 0cc52bc

File tree

5 files changed

+37
-63
lines changed

5 files changed

+37
-63
lines changed

tests/test_bookkeeper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def test_bookkeeping_descriptions(node_factory, bitcoind, chainparams):
743743
When an 'invoice' type event comes through, we look up the description details
744744
to include about the item. Particularly useful for CSV outputs etc.
745745
"""
746-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None})
746+
l1, l2 = node_factory.line_graph(2)
747747

748748
# Send l2 funds via the channel
749749
bolt11_desc = 'test "bolt11" description, 🥰🪢'

tests/test_pay.py

Lines changed: 31 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4227,7 +4227,7 @@ def test_mpp_overload_payee(node_factory, bitcoind):
42274227

42284228
def test_offer(node_factory, bitcoind):
42294229
plugin = os.path.join(os.path.dirname(__file__), 'plugins/currencyUSDAUD5000.py')
4230-
l1 = node_factory.get_node(options={'plugin': plugin, 'experimental-offers': None})
4230+
l1 = node_factory.get_node(options={'plugin': plugin})
42314231

42324232
# Try empty description
42334233
ret = l1.rpc.call('offer', [9, ''])
@@ -4411,8 +4411,7 @@ def test_offer(node_factory, bitcoind):
44114411

44124412

44134413
def test_offer_deprecated_api(node_factory, bitcoind):
4414-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None,
4415-
'allow-deprecated-apis': True})
4414+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
44164415

44174416
offer = l2.rpc.call('offer', {'amount': '2msat',
44184417
'description': 'test_offer_deprecated_api'})
@@ -4425,8 +4424,7 @@ def test_offer_deprecated_api(node_factory, bitcoind):
44254424

44264425
def test_fetchinvoice_3hop(node_factory, bitcoind):
44274426
l1, l2, l3, l4 = node_factory.line_graph(4, wait_for_announce=True,
4428-
opts={'experimental-offers': None,
4429-
'may_reconnect': True,
4427+
opts={'may_reconnect': True,
44304428
'dev-no-reconnect': None})
44314429
offer1 = l4.rpc.call('offer', {'amount': '2msat',
44324430
'description': 'simple test'})
@@ -4438,10 +4436,9 @@ def test_fetchinvoice_3hop(node_factory, bitcoind):
44384436
def test_fetchinvoice(node_factory, bitcoind):
44394437
# We remove the conversion plugin on l3, causing it to get upset.
44404438
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
4441-
opts=[{'experimental-offers': None},
4442-
{'experimental-offers': None},
4443-
{'experimental-offers': None,
4444-
'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'"}])
4439+
opts=[{},
4440+
{},
4441+
{'broken_log': "plugin-offers: Failed invreq.*Unknown command 'currencyconvert'"}])
44454442

44464443
# Simple offer first.
44474444
offer1 = l3.rpc.call('offer', {'amount': '2msat',
@@ -4536,7 +4533,7 @@ def test_fetchinvoice(node_factory, bitcoind):
45364533
# Check we can request invoice without a channel.
45374534
offer3 = l2.rpc.call('offer', {'amount': '1msat',
45384535
'description': 'offer3'})
4539-
l4 = node_factory.get_node(options={'experimental-offers': None})
4536+
l4 = node_factory.get_node()
45404537
l4.rpc.connect(l2.info['id'], 'localhost', l2.port)
45414538
# ... even if we can't find ourselves.
45424539
l4.rpc.call('fetchinvoice', {'offer': offer3['bolt12']})
@@ -4574,8 +4571,7 @@ def test_fetchinvoice(node_factory, bitcoind):
45744571

45754572
def test_fetchinvoice_recurrence(node_factory, bitcoind):
45764573
"""Test for our recurrence extension"""
4577-
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
4578-
opts={'experimental-offers': None})
4574+
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
45794575

45804576
# Recurring offer.
45814577
offer3 = l2.rpc.call('offer', {'amount': '1msat',
@@ -4672,10 +4668,9 @@ def test_fetchinvoice_autoconnect(node_factory, bitcoind):
46724668
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
46734669
# No onion_message support in l1
46744670
opts=[{'dev-force-features': -39},
4675-
{'experimental-offers': None,
4676-
'dev-allow-localhost': None}])
4671+
{'dev-allow-localhost': None}])
46774672

4678-
l3 = node_factory.get_node(options={'experimental-offers': None})
4673+
l3 = node_factory.get_node()
46794674
l3.rpc.connect(l1.info['id'], 'localhost', l1.port)
46804675
wait_for(lambda: l3.rpc.listnodes(l2.info['id'])['nodes'] != [])
46814676

@@ -4712,8 +4707,7 @@ def test_fetchinvoice_autoconnect(node_factory, bitcoind):
47124707
def test_fetchinvoice_disconnected_reply(node_factory, bitcoind):
47134708
"""We ask for invoice, but reply path doesn't lead directly from recipient"""
47144709
l1, l2, l3 = node_factory.get_nodes(3,
4715-
opts={'experimental-offers': None,
4716-
'may_reconnect': True,
4710+
opts={'may_reconnect': True,
47174711
'dev-no-reconnect': None,
47184712
'dev-allow-localhost': None})
47194713
l3.rpc.connect(l2.info['id'], 'localhost', l2.port)
@@ -4792,8 +4786,7 @@ def test_pay_waitblockheight_timeout(node_factory, bitcoind):
47924786

47934787

47944788
def test_dev_rawrequest(node_factory):
4795-
l1, l2 = node_factory.line_graph(2, fundchannel=False,
4796-
opts={'experimental-offers': None})
4789+
l1, l2 = node_factory.line_graph(2, fundchannel=False)
47974790

47984791
offer = l2.rpc.call('offer', {'amount': '2msat',
47994792
'description': 'simple test'})
@@ -4808,10 +4801,7 @@ def test_dev_rawrequest(node_factory):
48084801

48094802

48104803
def test_sendinvoice(node_factory, bitcoind):
4811-
l2opts = {'experimental-offers': None}
4812-
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
4813-
opts=[{'experimental-offers': None},
4814-
l2opts])
4804+
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
48154805

48164806
# Simple offer to send money (balances channel a little)
48174807
invreq = l1.rpc.call('invoicerequest', {'amount': '100000sat',
@@ -4873,11 +4863,9 @@ def test_sendinvoice(node_factory, bitcoind):
48734863

48744864

48754865
def test_sendinvoice_blindedpath(node_factory, bitcoind):
4876-
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
4877-
opts=[{},
4878-
{'experimental-offers': None}])
4866+
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
48794867
# We join l3->l1->l2 so l3 can pay invoice sent by l2.
4880-
l3 = node_factory.get_node(options={'experimental-offers': None})
4868+
l3 = node_factory.get_node()
48814869
node_factory.join_nodes([l3, l1], announce_channels=False)
48824870

48834871
# Make sure l3 knows l1, l2 is public, so it will create blinded path to it.
@@ -5338,8 +5326,7 @@ def test_fetchinvoice_with_no_quantity(node_factory):
53385326
In particular, in the fetchinvoice we forget to map the
53395327
quantity parameter with the invoice request quantity field.
53405328
"""
5341-
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
5342-
opts={'experimental-offers': None})
5329+
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
53435330
offer1 = l2.rpc.call('offer', {'amount': '2msat',
53445331
'description': 'simple test',
53455332
'quantity_max': 10})
@@ -5632,10 +5619,8 @@ def test_pay_partial_msat(node_factory, executor):
56325619

56335620
def test_blindedpath_privchan(node_factory, bitcoind):
56345621
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
5635-
opts={'experimental-offers': None,
5636-
'may_reconnect': True})
5637-
l3 = node_factory.get_node(options={'experimental-offers': None,
5638-
'cltv-final': 120},
5622+
opts={'may_reconnect': True})
5623+
l3 = node_factory.get_node(options={'cltv-final': 120},
56395624
may_reconnect=True)
56405625

56415626
# Private channel.
@@ -5677,8 +5662,7 @@ def test_blindedpath_privchan(node_factory, bitcoind):
56775662

56785663
def test_blinded_reply_path_scid(node_factory):
56795664
"""Check that we handle a blinded path which begins with a scid instead of a nodeid"""
5680-
l1, l2 = node_factory.line_graph(2, wait_for_announce=True,
5681-
opts={'experimental-offers': None})
5665+
l1, l2 = node_factory.line_graph(2, wait_for_announce=True)
56825666
offer = l2.rpc.offer(amount='2msat', description='test_blinded_reply_path_scid')
56835667

56845668
chan = only_one(l1.rpc.listpeerchannels()['channels'])
@@ -5705,8 +5689,7 @@ def test_pay_while_opening_channel(node_factory, bitcoind, executor):
57055689

57065690

57075691
def test_offer_paths(node_factory, bitcoind):
5708-
opts = {'experimental-offers': None,
5709-
'dev-allow-localhost': None}
5692+
opts = {'dev-allow-localhost': None}
57105693

57115694
# Need to announce channels to use their scid in offers anyway!
57125695
l1, l2, l3, l4 = node_factory.line_graph(4,
@@ -5791,8 +5774,7 @@ def test_pay_legacy_forward(node_factory, bitcoind, executor):
57915774
@pytest.mark.slow_test
57925775
def test_onionmessage_ratelimit(node_factory):
57935776
l1, l2 = node_factory.line_graph(2, fundchannel=False,
5794-
opts={'experimental-offers': None,
5795-
'allow_warning': True})
5777+
opts={'allow_warning': True})
57965778

57975779
offer = l2.rpc.call('offer', {'amount': '2msat',
57985780
'description': 'simple test'})
@@ -5812,8 +5794,7 @@ def test_onionmessage_ratelimit(node_factory):
58125794
def test_offer_path_self(node_factory):
58135795
"""We can fetch an offer, and pay an invoice which uses a blinded path starting at us"""
58145796
l1, l2, l3 = node_factory.line_graph(3, fundchannel=False,
5815-
opts={'experimental-offers': None,
5816-
'may_reconnect': True})
5797+
opts={'may_reconnect': True})
58175798

58185799
# Private channel from l2->l3, makes l3 add a hint.
58195800
node_factory.join_nodes([l1, l2], wait_for_announce=True)
@@ -5854,16 +5835,15 @@ def test_offer_path_self(node_factory):
58545835

58555836
def test_offer_selfpay(node_factory):
58565837
"""We can fetch an pay our own offer"""
5857-
l1 = node_factory.get_node(options={'experimental-offers': None})
5838+
l1 = node_factory.get_node()
58585839

58595840
offer = l1.rpc.offer(amount='2msat', description='test_offer_path_self')['bolt12']
58605841
inv = l1.rpc.fetchinvoice(offer)['invoice']
58615842
l1.rpc.pay(inv)
58625843

58635844

58645845
def test_decryptencrypteddata(node_factory):
5865-
l1, l2, l3 = node_factory.line_graph(3, fundchannel=False,
5866-
opts={'experimental-offers': None})
5846+
l1, l2, l3 = node_factory.line_graph(3, fundchannel=False)
58675847

58685848
# Private channel from l2->l3, makes l3 add a blinded path to invoice
58695849
# (l1's existence makes sure l3 doesn't see l2 as a dead end!)
@@ -5892,7 +5872,7 @@ def test_decryptencrypteddata(node_factory):
58925872

58935873

58945874
def test_offer_experimental_fields(node_factory):
5895-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None})
5875+
l1, l2 = node_factory.line_graph(2)
58965876

58975877
# Append experimental type 1000000001, length 1
58985878
offer = l1.rpc.offer(amount='2msat', description='test_offer_path_self')['bolt12']
@@ -5914,8 +5894,7 @@ def test_offer_experimental_fields(node_factory):
59145894

59155895
def test_fetch_no_description_offer(node_factory):
59165896
"""Reproducing the issue: https://github.com/ElementsProject/lightning/issues/7405"""
5917-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None,
5918-
'allow-deprecated-apis': True})
5897+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
59195898

59205899
# Deprecated fields make schema checker upset.
59215900
offer = l2.rpc.call('offer', {'amount': 'any'})
@@ -5931,8 +5910,7 @@ def test_fetch_no_description_offer(node_factory):
59315910

59325911
def test_fetch_no_description_with_amount(node_factory):
59335912
"""Reproducing the issue: https://github.com/ElementsProject/lightning/issues/7405"""
5934-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None,
5935-
'allow-deprecated-apis': True})
5913+
l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
59365914

59375915
# Deprecated fields make schema checker upset.
59385916
# BOLT-offers #12:
@@ -5984,7 +5962,7 @@ def test_decodepay(node_factory, chainparams):
59845962

59855963

59865964
def test_enableoffer(node_factory):
5987-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None})
5965+
l1, l2 = node_factory.line_graph(2)
59885966

59895967
# Normal offer, works as expected
59905968
offer1 = l2.rpc.call('offer', {'amount': '2msat',
@@ -6215,7 +6193,7 @@ def test_injectpaymentonion_3hop(node_factory, executor):
62156193

62166194

62176195
def test_injectpaymentonion_selfpay(node_factory, executor):
6218-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None})
6196+
l1, l2 = node_factory.line_graph(2)
62196197

62206198
blockheight = l1.rpc.getinfo()['blockheight']
62216199

@@ -6378,8 +6356,7 @@ def test_injectpaymentonion_selfpay(node_factory, executor):
63786356

63796357
def test_injectpaymentonion_blindedpath(node_factory, executor):
63806358
l1, l2 = node_factory.line_graph(2,
6381-
wait_for_announce=True,
6382-
opts={'experimental-offers': None})
6359+
wait_for_announce=True)
63836360
blockheight = l1.rpc.getinfo()['blockheight']
63846361

63856362
# Test bolt12, with stub blinded path.
@@ -6456,7 +6433,7 @@ def test_injectpaymentonion_blindedpath(node_factory, executor):
64566433
assert lsp['status'] == 'complete'
64576434

64586435
# Now test bolt12 with real blinded path.
6459-
l4 = node_factory.get_node(options={'experimental-offers': None})
6436+
l4 = node_factory.get_node()
64606437
# Private channel.
64616438
node_factory.join_nodes([l2, l4], announce_channels=False)
64626439

tests/test_plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3466,8 +3466,7 @@ def test_block_added_notifications(node_factory, bitcoind):
34663466

34673467
@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
34683468
def test_sql(node_factory, bitcoind):
3469-
opts = {'experimental-offers': None,
3470-
'experimental-dual-fund': None,
3469+
opts = {'experimental-dual-fund': None,
34713470
'dev-allow-localhost': None,
34723471
'may_reconnect': True}
34733472
l2opts = {'lease-fee-basis': 50,

tests/test_runes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ def test_rune_bolt11_parse(node_factory):
842842

843843

844844
def test_rune_bolt12_parse(node_factory):
845-
l1, l2 = node_factory.line_graph(2, opts={'experimental-offers': None})
845+
l1, l2 = node_factory.line_graph(2)
846846

847847
# Two invoices.
848848
l1inv_1msat = l2.rpc.fetchinvoice(l1.rpc.offer(1, "inv_1msat")['bolt12'])['invoice']

tests/test_xpay.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ def test_pay_fakenet(node_factory):
139139

140140

141141
def test_xpay_simple(node_factory):
142-
l1, l2, l3, l4 = node_factory.get_nodes(4, opts={'experimental-offers': None,
143-
'may_reconnect': True})
142+
l1, l2, l3, l4 = node_factory.get_nodes(4, opts={'may_reconnect': True})
144143
node_factory.join_nodes([l1, l2, l3], wait_for_announce=True)
145144
node_factory.join_nodes([l3, l4], announce_channels=False)
146145

@@ -201,7 +200,7 @@ def test_xpay_simple(node_factory):
201200

202201

203202
def test_xpay_selfpay(node_factory):
204-
l1 = node_factory.get_node(options={'experimental-offers': None})
203+
l1 = node_factory.get_node()
205204

206205
b11 = l1.rpc.invoice(1000, "test_xpay_selfpay1", "test_xpay_selfpay1")['bolt11']
207206
offer = l1.rpc.offer('any')
@@ -368,8 +367,7 @@ def test_xpay_partial_msat(node_factory, executor):
368367

369368
def test_xpay_takeover(node_factory, executor):
370369
l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True,
371-
opts={'xpay-handle-pay': True,
372-
'experimental-offers': None})
370+
opts={'xpay-handle-pay': True})
373371

374372
# xpay does NOT look like pay!
375373
l1.rpc.jsonschemas = {}

0 commit comments

Comments
 (0)