Test listfunds command.
(node_factory)
| 3390 | |
| 3391 | |
| 3392 | def 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 | |
| 3413 | def test_listforwards_and_listhtlcs(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected