Skip to content

Commit ec9a663

Browse files
committed
pytest: test what happens if we *explicitly* ask for a zeroconf channel.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 2d64741 commit ec9a663

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/test_opening.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,26 @@ def test_zeroconf_forward(node_factory, bitcoind):
18361836
l3.rpc.pay(inv)
18371837

18381838

1839+
def test_zeroconf_refusal(bitcoind, node_factory, chainparams):
1840+
"""If we're not going to give you zeroconf, we should tell you!"""
1841+
l1, l2 = node_factory.get_nodes(2)
1842+
l1.fundwallet(10**6)
1843+
l1.connect(l2)
1844+
1845+
# option_static_remotekey, option_zeroconf
1846+
ctype = [12, 50]
1847+
# No anchors for elements
1848+
if not chainparams['elements']:
1849+
ctype += [22]
1850+
with pytest.raises(RpcError, match="You required zeroconf, but you're not on our allowlist"):
1851+
l1.rpc.fundchannel(l2.info['id'], 'all', channel_type=ctype)
1852+
1853+
# OK, let's add ourselves to allow list.
1854+
plugin_path = str(Path(__file__).parent / "plugins" / "zeroconf-selective.py")
1855+
l2.rpc.plugin_start(plugin_path, zeroconf_allow=l1.info['id'])
1856+
l1.rpc.fundchannel(l2.info['id'], 'all', channel_type=ctype)
1857+
1858+
18391859
@pytest.mark.openchannel('v1')
18401860
def test_buy_liquidity_ad_no_v2(node_factory, bitcoind):
18411861
""" Test that you can't actually request amt for a

0 commit comments

Comments
 (0)