MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_zeroconf_refusal

Function test_zeroconf_refusal

tests/test_opening.py:2462–2479  ·  view source on GitHub ↗

If we're not going to give you zeroconf, we should tell you!

(bitcoind, node_factory, chainparams)

Source from the content-addressed store, hash-verified

2460
2461
2462def test_zeroconf_refusal(bitcoind, node_factory, chainparams):
2463 """If we're not going to give you zeroconf, we should tell you!"""
2464 l1, l2 = node_factory.get_nodes(2)
2465 l1.fundwallet(10**6)
2466 l1.connect(l2)
2467
2468 # option_static_remotekey, option_zeroconf
2469 ctype = [12, 50]
2470 # No anchors for elements
2471 if not chainparams['elements']:
2472 ctype += [22]
2473 with pytest.raises(RpcError, match="You required zeroconf, but you're not on our allowlist"):
2474 l1.rpc.fundchannel(l2.info['id'], 'all', channel_type=ctype)
2475
2476 # OK, let's add ourselves to allow list.
2477 plugin_path = str(Path(__file__).parent / "plugins" / "zeroconf-selective.py")
2478 l2.rpc.plugin_start(plugin_path, zeroconf_allow=l1.info['id'])
2479 l1.rpc.fundchannel(l2.info['id'], 'all', channel_type=ctype)
2480
2481
2482@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 5

get_nodesMethod · 0.80
fundwalletMethod · 0.80
plugin_startMethod · 0.80
connectMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected