Passes an custom extra tlv field to the hooks return that is malformed and should cause a broken log. l1 -- l2 -- l3
(node_factory)
| 2867 | |
| 2868 | |
| 2869 | def test_htlc_accepted_hook_malformedtlvs(node_factory): |
| 2870 | """ Passes an custom extra tlv field to the hooks return that is malformed |
| 2871 | and should cause a broken log. |
| 2872 | l1 -- l2 -- l3 |
| 2873 | """ |
| 2874 | plugin = os.path.join(os.path.dirname(__file__), 'plugins/htlc_accepted-customtlv.py') |
| 2875 | l1, l2, l3 = node_factory.line_graph(3, opts=[{}, {'plugin': plugin, 'broken_log': "lightningd: ", 'may_fail': True}, {}], wait_for_announce=True) |
| 2876 | |
| 2877 | mal_tlv = "fe00010001020539fdffff012a" # is malformed, types are 65537 and 65535 not in asc order. |
| 2878 | l2.rpc.setcustomtlvs(tlvs=mal_tlv) |
| 2879 | inv = l3.rpc.invoice(1000, 'customtlvs-maltlvs', '') |
| 2880 | phash = inv['payment_hash'] |
| 2881 | route = l1.single_route(l3.info['id'], 1000) |
| 2882 | |
| 2883 | # Here shouldn't use `pay` command because l2 should fail with a broken log. |
| 2884 | l1.rpc.sendpay(route, phash, payment_secret=inv['payment_secret']) |
| 2885 | assert l2.daemon.wait_for_log("BROKEN.*htlc_accepted_hook returned bad extra_tlvs") |
| 2886 | |
| 2887 | |
| 2888 | def test_hook_dep(node_factory): |
nothing calls this directly
no test coverage detected