(node_factory)
| 2824 | |
| 2825 | |
| 2826 | def test_htlc_accepted_hook_failmsg(node_factory): |
| 2827 | plugin = os.path.join(os.path.dirname(__file__), 'plugins/htlc_accepted-failmessage.py') |
| 2828 | l1, l2 = node_factory.line_graph(2, opts=[{}, {'plugin': plugin}]) |
| 2829 | |
| 2830 | # First let's test the newer failure_message, which should get passed |
| 2831 | # through without being mapped. |
| 2832 | tests = { |
| 2833 | '2002': 'temporary_node_failure', |
| 2834 | '400F' + 12 * '00': 'incorrect_or_unknown_payment_details', |
| 2835 | '4009': 'required_channel_feature_missing', |
| 2836 | '4016' + 3 * '00': 'invalid_onion_payload', |
| 2837 | } |
| 2838 | |
| 2839 | for failmsg, expected in tests.items(): |
| 2840 | l2.rpc.setfailmsg(msg=failmsg) |
| 2841 | inv = l2.rpc.invoice(42, 'failmsg{}'.format(failmsg), '')['bolt11'] |
| 2842 | with pytest.raises(RpcError, match=expected): |
| 2843 | l1.rpc.xpay(inv) |
| 2844 | |
| 2845 | |
| 2846 | def test_htlc_accepted_hook_customtlvs(node_factory): |
nothing calls this directly
no test coverage detected