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

Function test_includefees

tests/test_askrene.py:2324–2678  ·  view source on GitHub ↗

Test the amounts in the hops is set correctly when we use auto.include_fees layer.

(node_factory)

Source from the content-addressed store, hash-verified

2322
2323
2324def test_includefees(node_factory):
2325 """Test the amounts in the hops is set correctly when we use
2326 auto.include_fees layer."""
2327 gsfile, nodemap = generate_gossip_store(
2328 [
2329 GenChannel(
2330 0,
2331 1,
2332 capacity_sats=1000000,
2333 forward=GenChannel.Half(basefee=1, propfee=10000, delay=5),
2334 ),
2335 GenChannel(
2336 1,
2337 2,
2338 capacity_sats=1000000,
2339 forward=GenChannel.Half(basefee=2, propfee=20000, delay=5),
2340 ),
2341 GenChannel(
2342 2,
2343 3,
2344 capacity_sats=1000000,
2345 forward=GenChannel.Half(basefee=3, propfee=30000, delay=5),
2346 ),
2347 ]
2348 )
2349 l1 = node_factory.get_node(gossip_store_file=gsfile.name)
2350
2351 # Check computed fees in normal mode
2352 check_getroute_routes(
2353 l1,
2354 nodemap[0],
2355 nodemap[1],
2356 1000,
2357 [
2358 {
2359 "amount_msat": 1000,
2360 "path": [
2361 {
2362 "short_channel_id_dir": "0x1x0/1",
2363 "node_id_out": nodemap[1],
2364 "amount_in_msat": 1011,
2365 "cltv_in": 99 + 5,
2366 }
2367 ],
2368 }
2369 ],
2370 layers=[],
2371 )
2372
2373 check_getroute_routes(
2374 l1,
2375 nodemap[0],
2376 nodemap[2],
2377 1000,
2378 [
2379 {
2380 "amount_msat": 1000,
2381 "path": [

Callers

nothing calls this directly

Calls 4

generate_gossip_storeFunction · 0.90
GenChannelClass · 0.90
check_getroute_routesFunction · 0.85
get_nodeMethod · 0.45

Tested by

no test coverage detected