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

Function make_chans

tests/test_splice.py:561–575  ·  view source on GitHub ↗
(node_factory, qty=2, fundamount=1000000, balanced=True)

Source from the content-addressed store, hash-verified

559#
560# The channels for the second node are returned in chanids
561def make_chans(node_factory, qty=2, fundamount=1000000, balanced=True):
562 nodes = node_factory.line_graph(qty + 1, fundamount=fundamount, opts={'allow_bad_gossip': True})
563 chanids = []
564
565 for i in range(len(nodes) - 1):
566 nodes[i].daemon.wait_for_log(' to CHANNELD_NORMAL')
567 if balanced:
568 inv = nodes[i + 1].rpc.invoice(1000 * fundamount // 2, 'balance', 'balance')
569 nodes[i].rpc.xpay(inv['bolt11'])
570
571 chanids.insert(0, nodes[1].get_channel_id(nodes[0]))
572 if qty > 1:
573 chanids.insert(0, nodes[1].get_channel_id(nodes[2]))
574
575 return [nodes, chanids]
576
577
578def verify_chans(nodes, bitcoind, txid, chanids, fee, expected_balances=None, fee_multiplier=None):

Callers 1

execute_scriptFunction · 0.85

Calls 6

line_graphMethod · 0.80
wait_for_logMethod · 0.80
get_channel_idMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected