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

Function test_listfunds

tests/test_misc.py:3392–3410  ·  view source on GitHub ↗

Test listfunds command.

(node_factory)

Source from the content-addressed store, hash-verified

3390
3391
3392def test_listfunds(node_factory):
3393 """Test listfunds command."""
3394 l1, l2 = node_factory.get_nodes(2, opts=[{}, {}])
3395
3396 open_txid = l1.openchannel(l2, 10**5)["wallettxid"]
3397
3398 # unspent outputs
3399 utxos = l1.rpc.listfunds()["outputs"]
3400
3401 # only 1 unspent output should be available
3402 assert len(utxos) == 1
3403
3404 # both unspent and spent outputs
3405 all_outputs = l1.rpc.listfunds(spent=True)["outputs"]
3406 txids = [output['txid'] for output in all_outputs]
3407
3408 # 1 spent output (channel opening) and 1 unspent output
3409 assert len(all_outputs) == 2
3410 assert open_txid in txids
3411
3412
3413def test_listforwards_and_listhtlcs(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 3

get_nodesMethod · 0.80
openchannelMethod · 0.80
listfundsMethod · 0.45

Tested by

no test coverage detected