Simple test for multifundchannel, using v2
(node_factory, bitcoind)
| 1870 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
| 1871 | @pytest.mark.openchannel('v2') |
| 1872 | def test_multifunding_v2_exclusive(node_factory, bitcoind): |
| 1873 | ''' |
| 1874 | Simple test for multifundchannel, using v2 |
| 1875 | ''' |
| 1876 | # Two of three will reply with inputs of their own |
| 1877 | options = [{}, |
| 1878 | {'funder-policy': 'match', |
| 1879 | 'funder-policy-mod': 100, |
| 1880 | 'funder-fuzz-percent': 0, |
| 1881 | 'funder-lease-requests-only': False}, |
| 1882 | {'funder-policy': 'match', |
| 1883 | 'funder-policy-mod': 100, |
| 1884 | 'funder-fuzz-percent': 0, |
| 1885 | 'funder-lease-requests-only': False}, |
| 1886 | {}] |
| 1887 | l1, l2, l3, l4 = node_factory.get_nodes(4, opts=options) |
| 1888 | |
| 1889 | l1.fundwallet(2000000) |
| 1890 | l2.fundwallet(2000000) |
| 1891 | l3.fundwallet(2000000) |
| 1892 | |
| 1893 | destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port), |
| 1894 | "amount": 50000}, |
| 1895 | {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port), |
| 1896 | "amount": 50000}, |
| 1897 | {"id": '{}@localhost:{}'.format(l4.info['id'], l4.port), |
| 1898 | "amount": 50000}] |
| 1899 | |
| 1900 | l1.rpc.multifundchannel(destinations) |
| 1901 | mine_funding_to_announce(bitcoind, [l1, l2, l3], num_blocks=6, wait_for_mempool=1) |
| 1902 | |
| 1903 | for node in [l1, l2, l3, l4]: |
| 1904 | node.daemon.wait_for_log(r'to CHANNELD_NORMAL') |
| 1905 | |
| 1906 | # For dual-funded channels, pay from accepter to initiator |
| 1907 | for ldest in [l2, l3]: |
| 1908 | inv = l1.rpc.invoice(5000, 'inv' + ldest.info['id'], 'inv')['bolt11'] |
| 1909 | ldest.rpc.xpay(inv) |
| 1910 | |
| 1911 | # Then pay other direction |
| 1912 | for ldest in [l2, l3, l4]: |
| 1913 | inv = ldest.rpc.invoice(10000, 'inv', 'inv')['bolt11'] |
| 1914 | l1.rpc.xpay(inv) |
| 1915 | |
| 1916 | |
| 1917 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected