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

Function test_min_htlc

tests/test_askrene.py:1530–1546  ·  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

1528
1529
1530def test_min_htlc(node_factory, bitcoind):
1531 """A route which looks good isn't actually, because of min htlc limits. Should fall back!"""
1532 gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, capacity_sats=500_000,
1533 forward=GenChannel.Half(htlc_min=2_000)),
1534 GenChannel(0, 1, capacity_sats=20_000)])
1535 l1 = node_factory.get_node(gossip_store_file=gsfile.name)
1536
1537 routes = l1.rpc.getroutes(source=nodemap[0],
1538 destination=nodemap[1],
1539 amount_msat=1000,
1540 layers=[],
1541 maxfee_msat=20_000_000,
1542 final_cltv=10)
1543
1544 dir01 = direction(nodemap[0], nodemap[1])
1545 check_route_as_expected(routes['routes'],
1546 [[{'short_channel_id_dir': f'1x1x1/{dir01}', 'amount_in_msat': 1_000, 'cltv_in': 10 + 6}]])
1547
1548
1549def 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