(node_factory, executor)
| 658 | |
| 659 | |
| 660 | def test_wait_sendpay(node_factory, executor): |
| 661 | l1, l2 = node_factory.line_graph(2, fundamount=10**6) |
| 662 | |
| 663 | assert l1.rpc.wait(subsystem='sendpays', indexname='created', nextvalue=0) == {'subsystem': 'sendpays', 'created': 0} |
| 664 | |
| 665 | wait_created = executor.submit(l1.rpc.call, 'wait', {'subsystem': 'sendpays', 'indexname': 'created', 'nextvalue': 1}) |
| 666 | wait_updated = executor.submit(l1.rpc.call, 'wait', {'subsystem': 'sendpays', 'indexname': 'updated', 'nextvalue': 1}) |
| 667 | l1.daemon.wait_for_logs(['waiting on sendpays created 1', 'waiting on sendpays updated 1']) |
| 668 | |
| 669 | amt = 200000000 |
| 670 | inv = l2.rpc.invoice(amt, 'testpayment2', 'desc') |
| 671 | routestep = { |
| 672 | 'amount_msat': amt, |
| 673 | 'id': l2.info['id'], |
| 674 | 'delay': 5, |
| 675 | 'channel': first_scid(l1, l2) |
| 676 | } |
| 677 | l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret']) |
| 678 | assert wait_created.result(TIMEOUT) == {'subsystem': 'sendpays', |
| 679 | 'created': 1, |
| 680 | 'sendpays': {'groupid': 1, |
| 681 | 'partid': 0, |
| 682 | 'payment_hash': inv['payment_hash'], |
| 683 | 'status': 'pending'}} |
| 684 | assert wait_updated.result(TIMEOUT) == {'subsystem': 'sendpays', |
| 685 | 'updated': 1, |
| 686 | 'sendpays': {'groupid': 1, |
| 687 | 'partid': 0, |
| 688 | 'payment_hash': inv['payment_hash'], |
| 689 | 'status': 'complete'}} |
| 690 | |
| 691 | l1.rpc.waitsendpay(inv['payment_hash'])['payment_preimage'] |
| 692 | |
| 693 | |
| 694 | def test_sendpay_onion_overflow(node_factory): |
nothing calls this directly
no test coverage detected