(node_factory)
| 636 | |
| 637 | |
| 638 | def test_repay(node_factory): |
| 639 | l1, l2 = node_factory.line_graph(2, fundamount=10**6) |
| 640 | |
| 641 | amt = 200000000 |
| 642 | inv = l2.rpc.invoice(amt, 'testpayment2', 'desc') |
| 643 | routestep = { |
| 644 | 'amount_msat': amt, |
| 645 | 'id': l2.info['id'], |
| 646 | 'delay': 5, |
| 647 | 'channel': first_scid(l1, l2) |
| 648 | } |
| 649 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 650 | l1.daemon.wait_for_log("Sending 200000000msat over 1 hops to deliver 200000000msat") |
| 651 | l1.rpc.waitsendpay(inv['payment_hash'])['payment_preimage'] |
| 652 | |
| 653 | # Re-attempt is instant |
| 654 | assert l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret'])['status'] == 'complete' |
| 655 | |
| 656 | # Don't re-log that we are sending! |
| 657 | assert l1.daemon.is_in_log("Sending 200000000msat over 1 hops to deliver 200000000msat", start=l1.daemon.logsearch_start) is None |
| 658 | |
| 659 | |
| 660 | def test_wait_sendpay(node_factory, executor): |
nothing calls this directly
no test coverage detected