Try to create a giant channel
(node_factory, bitcoind)
| 1091 | @pytest.mark.openchannel('v1') |
| 1092 | @pytest.mark.openchannel('v2') |
| 1093 | def test_funding_toolarge(node_factory, bitcoind): |
| 1094 | """Try to create a giant channel""" |
| 1095 | l1 = node_factory.get_node() |
| 1096 | l2 = node_factory.get_node() |
| 1097 | l1.rpc.connect(l2.info['id'], 'localhost', l2.port) |
| 1098 | |
| 1099 | # Send funds. |
| 1100 | amount = 2**24 |
| 1101 | bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['bech32'], amount / 10**8 + 0.01) |
| 1102 | bitcoind.generate_block(1) |
| 1103 | |
| 1104 | # Wait for it to arrive. |
| 1105 | wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0) |
| 1106 | |
| 1107 | # Fail to open (too large) |
| 1108 | with pytest.raises(RpcError, match=r'Amount exceeded 16777215'): |
| 1109 | l1.rpc.fundchannel(l2.info['id'], amount) |
| 1110 | |
| 1111 | # This should work. |
| 1112 | amount = amount - 1 |
| 1113 | l1.rpc.fundchannel(l2.info['id'], amount) |
| 1114 | |
| 1115 | |
| 1116 | @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') |
nothing calls this directly
no test coverage detected