Repro test for issue 4345: pay ourselves via the pay plugin.
(node_factory)
| 5124 | |
| 5125 | |
| 5126 | def test_self_pay(node_factory): |
| 5127 | """Repro test for issue 4345: pay ourselves via the pay plugin. |
| 5128 | |
| 5129 | """ |
| 5130 | l1, l2 = node_factory.line_graph(2, wait_for_announce=True, |
| 5131 | opts={'xpay-handle-pay': False, |
| 5132 | 'allow-deprecated-apis': True}) |
| 5133 | |
| 5134 | inv = l1.rpc.invoice(10000, 'test', 'test')['bolt11'] |
| 5135 | l1.rpc.pay(inv) |
| 5136 | |
| 5137 | # We can pay twice, no problem! |
| 5138 | l1.rpc.pay(inv) |
| 5139 | |
| 5140 | inv2 = l1.rpc.invoice(10000, 'test2', 'test2')['bolt11'] |
| 5141 | l1.rpc.delinvoice('test2', 'unpaid') |
| 5142 | |
| 5143 | with pytest.raises(RpcError, match=r'Unknown invoice') as excinfo: |
| 5144 | l1.rpc.pay(inv2) |
| 5145 | assert excinfo.value.error['code'] == 203 |
| 5146 | |
| 5147 | |
| 5148 | @unittest.skipIf(TEST_NETWORK != 'regtest', "Canned invoice is network specific") |
nothing calls this directly
no test coverage detected