Test that multifunding handles errors in parameters.
(node_factory)
| 2161 | |
| 2162 | |
| 2163 | def test_multifunding_param_failures(node_factory): |
| 2164 | ''' |
| 2165 | Test that multifunding handles errors in parameters. |
| 2166 | ''' |
| 2167 | l1, l2, l3 = node_factory.get_nodes(3) |
| 2168 | |
| 2169 | l1.fundwallet(1 << 26) |
| 2170 | |
| 2171 | # No connection hint to unconnected node. |
| 2172 | destinations = [{"id": '{}'.format(l2.info['id']), |
| 2173 | "amount": 50000}, |
| 2174 | {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port), |
| 2175 | "amount": 50000}] |
| 2176 | with pytest.raises(RpcError): |
| 2177 | l1.rpc.multifundchannel(destinations) |
| 2178 | |
| 2179 | # Duplicated destination. |
| 2180 | destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port), |
| 2181 | "amount": 50000}, |
| 2182 | {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port), |
| 2183 | "amount": 50000}, |
| 2184 | {"id": '{}@localhost:{}'.format(l2.info['id'], l2.port), |
| 2185 | "amount": 50000}] |
| 2186 | with pytest.raises(RpcError): |
| 2187 | l1.rpc.multifundchannel(destinations) |
| 2188 | |
| 2189 | # Empty destinations. |
| 2190 | with pytest.raises(RpcError): |
| 2191 | l1.rpc.multifundchannel([]) |
| 2192 | |
| 2193 | # Required destination fields missing. |
| 2194 | l1.rpc.check_request_schemas = False |
| 2195 | destinations = [{"id": '{}@localhost:{}'.format(l2.info['id'], l2.port), |
| 2196 | "amount": 50000}, |
| 2197 | {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port)}] |
| 2198 | with pytest.raises(RpcError): |
| 2199 | l1.rpc.multifundchannel(destinations) |
| 2200 | destinations = [{"amount": 50000}, |
| 2201 | {"id": '{}@localhost:{}'.format(l3.info['id'], l3.port), |
| 2202 | "amount": 50000}] |
| 2203 | with pytest.raises(RpcError): |
| 2204 | l1.rpc.multifundchannel(destinations) |
| 2205 | |
| 2206 | |
| 2207 | @pytest.mark.openchannel('v1') |
nothing calls this directly
no test coverage detected