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

Function test_multifunding_simple

tests/test_connection.py:1912–1938  ·  view source on GitHub ↗

Simple test for multifundchannel.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

1910@pytest.mark.openchannel('v1')
1911@pytest.mark.openchannel('v2')
1912def test_multifunding_simple(node_factory, bitcoind):
1913 '''
1914 Simple test for multifundchannel.
1915 '''
1916 l1, l2, l3, l4 = node_factory.get_nodes(4)
1917
1918 l1.fundwallet(2000000)
1919
1920 destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port),
1921 "amount": 50000},
1922 {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port),
1923 "amount": 50000},
1924 {"id": '{}@localhost:{}'.format(l4.info['id'], l4.port),
1925 "amount": 50000}]
1926
1927 l1.rpc.multifundchannel(destinations)
1928 bitcoind.generate_block(1, wait_for_mempool=1)
1929 # Don't have others reject channel_announcement as too far in future.
1930 sync_blockheight(bitcoind, [l1, l2, l3, l4])
1931 bitcoind.generate_block(5)
1932
1933 for node in [l1, l2, l3, l4]:
1934 node.daemon.wait_for_log(r'to CHANNELD_NORMAL')
1935
1936 for ldest in [l2, l3, l4]:
1937 inv = ldest.rpc.invoice(5000, 'inv', 'inv')['bolt11']
1938 l1.rpc.xpay(inv)
1939
1940
1941@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 8

sync_blockheightFunction · 0.90
get_nodesMethod · 0.80
fundwalletMethod · 0.80
multifundchannelMethod · 0.80
generate_blockMethod · 0.80
wait_for_logMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected