(node_factory, bitcoind, chainparams)
| 831 | @pytest.mark.openchannel('v2') |
| 832 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
| 833 | def test_easy_splice_out(node_factory, bitcoind, chainparams): |
| 834 | fundamt = 1000000 |
| 835 | |
| 836 | coin_mvt_plugin = Path(__file__).parent / "plugins" / "coin_movements.py" |
| 837 | l1, l2 = node_factory.line_graph(2, fundamount=fundamt, wait_for_announce=True, |
| 838 | opts={'plugin': coin_mvt_plugin}) |
| 839 | |
| 840 | initial_wallet_balance = Millisatoshi(bkpr_account_balance(l1, 'wallet')) |
| 841 | |
| 842 | # Splice out 100k from first channel, putting result less fees into onchain wallet |
| 843 | spliceamt = 100000 |
| 844 | l1.rpc.spliceout("*:?", f"{spliceamt}", force_feerate=True) |
| 845 | |
| 846 | bitcoind.generate_block(6, wait_for_mempool=1) |
| 847 | l2.daemon.wait_for_log(r'lightningd, splice_locked clearing inflights') |
| 848 | |
| 849 | p1 = only_one(l1.rpc.listpeerchannels(peer_id=l2.info['id'])['channels']) |
| 850 | p2 = only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels']) |
| 851 | assert 'inflight' not in p1 |
| 852 | assert 'inflight' not in p2 |
| 853 | |
| 854 | wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 2) |
| 855 | wait_for(lambda: len(l1.rpc.listfunds()['channels']) == 1) |
| 856 | |
| 857 | end_wallet_balance = Millisatoshi(bkpr_account_balance(l1, 'wallet')) |
| 858 | assert initial_wallet_balance + Millisatoshi(spliceamt * 1000) == end_wallet_balance |
| 859 | |
| 860 | |
| 861 | @pytest.mark.xfail(strict=True) |
nothing calls this directly
no test coverage detected