Skip to content

Commit 2d64741

Browse files
committed
pytest: use _ not - in plugin options to zeroconf-selective.py.
This allows us to specify: l2.rpc.plugin_start(plugin_path, zeroconf_allow=l1.info['id']) Signed-off-by: Rusty Russell <[email protected]>
1 parent c623efd commit 2d64741

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

tests/plugins/zeroconf-selective.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@
1010
@plugin.hook('openchannel')
1111
def on_openchannel(openchannel, plugin, **kwargs):
1212
plugin.log(repr(openchannel))
13-
mindepth = int(plugin.options['zeroconf-mindepth']['value'])
13+
mindepth = int(plugin.options['zeroconf_mindepth']['value'])
1414

15-
if openchannel['id'] == plugin.options['zeroconf-allow']['value'] or plugin.options['zeroconf-allow']['value'] == 'any':
15+
if openchannel['id'] == plugin.options['zeroconf_allow']['value'] or plugin.options['zeroconf_allow']['value'] == 'any':
1616
plugin.log(f"This peer is in the zeroconf allowlist, setting mindepth={mindepth}")
1717
return {'result': 'continue', 'mindepth': mindepth}
1818
else:
1919
return {'result': 'continue'}
2020

2121

2222
plugin.add_option(
23-
'zeroconf-allow',
23+
'zeroconf_allow',
2424
'03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f',
2525
'A node_id to allow zeroconf channels from',
2626
)
2727

2828
plugin.add_option(
29-
'zeroconf-mindepth',
29+
'zeroconf_mindepth',
3030
0,
3131
'Number of confirmations to require from allowlisted peers',
3232
)

tests/test_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,7 +1390,7 @@ def test_funding_reorg_private(node_factory, bitcoind):
13901390
'dev-fast-reconnect': None,
13911391
# if it's not zeroconf, we'll terminate on reorg.
13921392
'plugin': os.path.join(os.getcwd(), 'tests/plugins/zeroconf-selective.py'),
1393-
'zeroconf-allow': 'any'}
1393+
'zeroconf_allow': 'any'}
13941394
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts=opts)
13951395
l1.fundwallet(10000000)
13961396
sync_blockheight(bitcoind, [l1]) # height 102
@@ -1433,7 +1433,7 @@ def test_funding_reorg_remote_lags(node_factory, bitcoind):
14331433
'allow_warning': True, 'dev-fast-reconnect': None,
14341434
# if it's not zeroconf, l2 will terminate on reorg.
14351435
'plugin': os.path.join(os.getcwd(), 'tests/plugins/zeroconf-selective.py'),
1436-
'zeroconf-allow': 'any'}
1436+
'zeroconf_allow': 'any'}
14371437
l1, l2 = node_factory.line_graph(2, fundchannel=False, opts=opts)
14381438
l1.fundwallet(10000000)
14391439
sync_blockheight(bitcoind, [l1]) # height 102

tests/test_opening.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,8 +1580,8 @@ def test_zeroconf_mindepth(bitcoind, node_factory):
15801580
{},
15811581
{
15821582
'plugin': str(plugin_path),
1583-
'zeroconf-allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518',
1584-
'zeroconf-mindepth': '2',
1583+
'zeroconf_allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518',
1584+
'zeroconf_mindepth': '2',
15851585
},
15861586
])
15871587

@@ -1627,7 +1627,7 @@ def test_zeroconf_open(bitcoind, node_factory):
16271627
{},
16281628
{
16291629
'plugin': str(plugin_path),
1630-
'zeroconf-allow': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'
1630+
'zeroconf_allow': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'
16311631
},
16321632
])
16331633

@@ -1702,7 +1702,7 @@ def test_zeroconf_public(bitcoind, node_factory, chainparams):
17021702
{'plugin': str(coin_mvt_plugin)},
17031703
{
17041704
'plugin': str(plugin_path),
1705-
'zeroconf-allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'
1705+
'zeroconf_allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'
17061706
},
17071707
{}
17081708
])
@@ -1804,7 +1804,7 @@ def test_zeroconf_forward(node_factory, bitcoind):
18041804
{},
18051805
{
18061806
'plugin': str(plugin_path),
1807-
'zeroconf-allow': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'
1807+
'zeroconf_allow': '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'
18081808
}
18091809
]
18101810
l1, l2, l3 = node_factory.get_nodes(3, opts=opts)
@@ -2054,7 +2054,7 @@ def test_zeroconf_multichan_forward(node_factory):
20542054
{},
20552055
{
20562056
'plugin': str(plugin_path),
2057-
'zeroconf-allow': node_id,
2057+
'zeroconf_allow': node_id,
20582058
}
20592059
], fundamount=10**6, wait_for_announce=True)
20602060

@@ -2574,7 +2574,7 @@ def test_opening_explicit_channel_type(node_factory, bitcoind):
25742574
l1, l2, l3, l4 = node_factory.get_nodes(4,
25752575
opts=[{'experimental-dual-fund': None},
25762576
{'plugin': str(plugin_path),
2577-
'zeroconf-allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'},
2577+
'zeroconf_allow': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'},
25782578
{'experimental-dual-fund': None},
25792579
{}])
25802580

@@ -2707,8 +2707,8 @@ def test_zeroconf_forget(node_factory, bitcoind, dopay: bool):
27072707
{},
27082708
{
27092709
"plugin": str(plugin_path),
2710-
"zeroconf-allow": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
2711-
"zeroconf-mindepth": "0",
2710+
"zeroconf_allow": "0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518",
2711+
"zeroconf_mindepth": "0",
27122712
"dev-max-funding-unconfirmed-blocks": blocks,
27132713
},
27142714
{},

tests/test_pay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5278,7 +5278,7 @@ def test_pay_multichannel_use_zeroconf(bitcoind, node_factory):
52785278
fundamount=200_000,
52795279
opts=[{},
52805280
{'plugin': zeroconf_plugin,
5281-
'zeroconf-allow': 'any'}])
5281+
'zeroconf_allow': 'any'}])
52825282

52835283
# 1. Open a zeoconf channel l1 -> l2
52845284
zeroconf_sats = 1_000_000

tests/test_xpay.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ def test_xpay_zeroconf(node_factory):
604604
l1, l2 = node_factory.get_nodes(2,
605605
opts=[{},
606606
{'plugin': zeroconf_plugin,
607-
'zeroconf-allow': 'any'}])
607+
'zeroconf_allow': 'any'}])
608608

609609
l1.fundwallet(FUNDAMOUNT * 2)
610610
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)

0 commit comments

Comments
 (0)