(node_factory, bitcoind)
| 5357 | |
| 5358 | @pytest.mark.flaky(reruns=2) |
| 5359 | def test_pay_manual_exclude(node_factory, bitcoind): |
| 5360 | l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True, |
| 5361 | opts={'xpay-handle-pay': False, |
| 5362 | 'allow-deprecated-apis': True}) |
| 5363 | l1_id = l1.rpc.getinfo()['id'] |
| 5364 | l2_id = l2.rpc.getinfo()['id'] |
| 5365 | l3_id = l3.rpc.getinfo()['id'] |
| 5366 | chan12 = l1.rpc.listpeerchannels(l2_id)['channels'][0] |
| 5367 | chan23 = l2.rpc.listpeerchannels(l3_id)['channels'][0] |
| 5368 | scid12 = chan12['short_channel_id'] + '/' + str(chan12['direction']) |
| 5369 | scid23 = chan23['short_channel_id'] + '/' + str(chan23['direction']) |
| 5370 | inv = l3.rpc.invoice(amount_msat=123000, label='label1', description='desc')['bolt11'] |
| 5371 | # Exclude the payer node id |
| 5372 | with pytest.raises(RpcError, match=r'Payer is manually excluded'): |
| 5373 | l1.rpc.pay(inv, exclude=[l1_id]) |
| 5374 | # Exclude the direct payee node id |
| 5375 | with pytest.raises(RpcError, match=r'Payee is manually excluded'): |
| 5376 | l2.rpc.pay(inv, exclude=[l3_id]) |
| 5377 | # Exclude intermediate node id |
| 5378 | with pytest.raises(RpcError, match=r'is not reachable directly and all routehints were unusable.'): |
| 5379 | l1.rpc.pay(inv, exclude=[l2_id]) |
| 5380 | # Exclude intermediate channel id |
| 5381 | with pytest.raises(RpcError, match=r'is not reachable directly and all routehints were unusable.'): |
| 5382 | l1.rpc.pay(inv, exclude=[scid12]) |
| 5383 | # Exclude direct channel id |
| 5384 | with pytest.raises(RpcError, match=r'is not reachable directly and all routehints were unusable.'): |
| 5385 | l2.rpc.pay(inv, exclude=[scid23]) |
| 5386 | |
| 5387 | |
| 5388 | @unittest.skipIf(TEST_NETWORK != 'regtest', "Invoice is network specific") |
nothing calls this directly
no test coverage detected