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

Function test_min_htlc

tests/test_askrene.py:1448–1464  ·  view source on GitHub ↗

A route which looks good isn't actually, because of min htlc limits. Should fall back!

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

1446
1447
1448def test_min_htlc(node_factory, bitcoind):
1449 """A route which looks good isn't actually, because of min htlc limits. Should fall back!"""
1450 gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, capacity_sats=500_000,
1451 forward=GenChannel.Half(htlc_min=2_000)),
1452 GenChannel(0, 1, capacity_sats=20_000)])
1453 l1 = node_factory.get_node(gossip_store_file=gsfile.name)
1454
1455 routes = l1.rpc.getroutes(source=nodemap[0],
1456 destination=nodemap[1],
1457 amount_msat=1000,
1458 layers=[],
1459 maxfee_msat=20_000_000,
1460 final_cltv=10)
1461
1462 dir01 = direction(nodemap[0], nodemap[1])
1463 check_route_as_expected(routes['routes'],
1464 [[{'short_channel_id_dir': f'1x1x1/{dir01}', 'amount_in_msat': 1_000, 'cltv_in': 10 + 6}]])
1465
1466
1467def test_min_htlc_after_excess(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 6

generate_gossip_storeFunction · 0.90
GenChannelClass · 0.90
check_route_as_expectedFunction · 0.85
getroutesMethod · 0.80
directionFunction · 0.70
get_nodeMethod · 0.45

Tested by

no test coverage detected