(node_factory)
| 3000 | |
| 3001 | |
| 3002 | def test_htlc_accepted_hook_fwdto(node_factory): |
| 3003 | plugin = os.path.join(os.path.dirname(__file__), 'plugins/htlc_accepted-fwdto.py') |
| 3004 | l1, l2, l3 = node_factory.line_graph(3, opts=[{}, {'plugin': plugin}, {}], wait_for_announce=True) |
| 3005 | |
| 3006 | # Add some balance |
| 3007 | l1.rpc.xpay(l2.rpc.invoice(10**9 // 2, 'balance', '')['bolt11']) |
| 3008 | wait_for(lambda: only_one(l1.rpc.listpeerchannels()['channels'])['htlcs'] == []) |
| 3009 | |
| 3010 | # make it forward back down same channel. |
| 3011 | l2.rpc.setfwdto(only_one(l1.rpc.listpeerchannels()['channels'])['channel_id']) |
| 3012 | inv = l3.rpc.invoice(42, 'fwdto', '')['bolt11'] |
| 3013 | with pytest.raises(RpcError, match=r"Unexpected error \(invalid_onion_hmac\) from intermediate node: disabling the invoice's route hint"): |
| 3014 | l1.rpc.xpay(inv) |
| 3015 | |
| 3016 | assert l2.rpc.listforwards()['forwards'][0]['out_channel'] == only_one(l1.rpc.listpeerchannels()['channels'])['short_channel_id'] |
| 3017 | |
| 3018 | |
| 3019 | def test_dynamic_args(node_factory): |
nothing calls this directly
no test coverage detected