MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_htlc_accepted_hook_failmsg

Function test_htlc_accepted_hook_failmsg

tests/test_plugin.py:2826–2843  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

2824
2825
2826def 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
2846def test_htlc_accepted_hook_customtlvs(node_factory):

Callers

nothing calls this directly

Calls 4

joinMethod · 0.80
line_graphMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected