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

Function test_v2_open

tests/test_connection.py:1183–1203  ·  view source on GitHub ↗
(node_factory, bitcoind, chainparams)

Source from the content-addressed store, hash-verified

1181@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
1182@pytest.mark.openchannel('v2')
1183def test_v2_open(node_factory, bitcoind, chainparams):
1184 l1, l2 = node_factory.get_nodes(2)
1185
1186 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
1187 amount = 2**24
1188 bitcoind.rpc.sendtoaddress(l1.rpc.newaddr('bech32')['bech32'], amount / 10**8 + 0.01)
1189 bitcoind.generate_block(1)
1190 # Wait for it to arrive.
1191 wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0)
1192
1193 l1.rpc.fundchannel(l2.info['id'], 'all')
1194
1195 bitcoind.generate_block(1)
1196 sync_blockheight(bitcoind, [l1])
1197 l1.daemon.wait_for_log(' to CHANNELD_NORMAL')
1198
1199 # Send a payment over the channel
1200 p = l2.rpc.invoice(100000, 'testpayment', 'desc')
1201 l1.rpc.xpay(p['bolt11'])
1202 result = only_one(l1.rpc.listsendpays(payment_hash=p['payment_hash'])['payments'])
1203 assert(result['status'] == 'complete')
1204
1205
1206@pytest.mark.openchannel('v1')

Callers

nothing calls this directly

Calls 13

wait_forFunction · 0.90
sync_blockheightFunction · 0.90
only_oneFunction · 0.90
get_nodesMethod · 0.80
generate_blockMethod · 0.80
wait_for_logMethod · 0.80
listsendpaysMethod · 0.80
connectMethod · 0.45
newaddrMethod · 0.45
listfundsMethod · 0.45
fundchannelMethod · 0.45
invoiceMethod · 0.45

Tested by

no test coverage detected