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

Function test_multifunding_one

tests/test_connection.py:1975–2004  ·  view source on GitHub ↗

Test that multifunding can still fund to one destination.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

1973@pytest.mark.openchannel('v1')
1974@pytest.mark.openchannel('v2')
1975def test_multifunding_one(node_factory, bitcoind):
1976 '''
1977 Test that multifunding can still fund to one destination.
1978 '''
1979 l1, l2, l3 = node_factory.get_nodes(3)
1980
1981 l1.fundwallet(2000000)
1982
1983 destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port),
1984 "amount": 50000}]
1985
1986 l1.rpc.multifundchannel(destinations)
1987
1988 # Now check if we connect to the node first before
1989 # multifundchannel.
1990 l1.rpc.connect(l3.info['id'], 'localhost', port=l3.port)
1991 # Omit the connect hint.
1992 destinations = [{"id": '{}'.format(l3.info['id']),
1993 "amount": 50000}]
1994
1995 l1.rpc.multifundchannel(destinations, minconf=0)
1996
1997 mine_funding_to_announce(bitcoind, [l1, l2, l3], num_blocks=6)
1998
1999 for node in [l1, l2, l3]:
2000 node.daemon.wait_for_log(r'to CHANNELD_NORMAL')
2001
2002 for ldest in [l2, l3]:
2003 inv = ldest.rpc.invoice(5000, 'inv', 'inv')['bolt11']
2004 l1.rpc.xpay(inv)
2005
2006
2007@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 8

mine_funding_to_announceFunction · 0.90
get_nodesMethod · 0.80
fundwalletMethod · 0.80
multifundchannelMethod · 0.80
wait_for_logMethod · 0.80
connectMethod · 0.45
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected