Add some funds, fund a channel using all funds, make sure no funds remain
(node_factory, bitcoind)
| 1055 | @pytest.mark.openchannel('v1') |
| 1056 | @pytest.mark.openchannel('v2') |
| 1057 | def test_funding_all(node_factory, bitcoind): |
| 1058 | """Add some funds, fund a channel using all funds, make sure no funds remain |
| 1059 | """ |
| 1060 | l1, l2 = node_factory.line_graph(2, fundchannel=False) |
| 1061 | |
| 1062 | l1.fundwallet(0.1 * 10**8) |
| 1063 | bitcoind.generate_block(1) |
| 1064 | sync_blockheight(bitcoind, [l1]) |
| 1065 | |
| 1066 | outputs = l1.db_query('SELECT value FROM outputs WHERE status=0;') |
| 1067 | assert only_one(outputs)['value'] == 10000000 |
| 1068 | |
| 1069 | l1.rpc.fundchannel(l2.info['id'], "all") |
| 1070 | |
| 1071 | # Keeps emergency reserve! |
| 1072 | outputs = l1.db_query('SELECT value FROM outputs WHERE status=0;') |
| 1073 | if 'anchors/even' in only_one(l1.rpc.listpeerchannels()['channels'])['channel_type']['names']: |
| 1074 | assert outputs == [{'value': 25000}] |
| 1075 | else: |
| 1076 | assert outputs == [] |
| 1077 | |
| 1078 | |
| 1079 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected