Test getroutes call takes into account fees, if excessive
(node_factory)
| 935 | |
| 936 | |
| 937 | def test_getroutes_fee_fallback(node_factory): |
| 938 | """Test getroutes call takes into account fees, if excessive""" |
| 939 | |
| 940 | # 0 -> 1 -> 3: high capacity, high fee (1%) |
| 941 | # 0 -> 2 -> 3: low capacity, low fee. |
| 942 | # (We disable reverse, since it breaks median calc!) |
| 943 | gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, |
| 944 | capacity_sats=20000, |
| 945 | forward=GenChannel.Half(propfee=10000), |
| 946 | reverse=GenChannel.Half(enabled=False)), |
| 947 | GenChannel(0, 2, |
| 948 | capacity_sats=10000, |
| 949 | reverse=GenChannel.Half(enabled=False)), |
| 950 | GenChannel(1, 3, |
| 951 | capacity_sats=20000, |
| 952 | forward=GenChannel.Half(propfee=10000), |
| 953 | reverse=GenChannel.Half(enabled=False)), |
| 954 | GenChannel(2, 3, |
| 955 | capacity_sats=10000, |
| 956 | reverse=GenChannel.Half(enabled=False))]) |
| 957 | # Set up l1 with this as the gossip_store |
| 958 | l1 = node_factory.get_node(gossip_store_file=gsfile.name) |
| 959 | |
| 960 | # Don't hit maxfee? Go easy path. |
| 961 | dir01 = direction(nodemap[0], nodemap[1]) |
| 962 | dir13 = direction(nodemap[1], nodemap[3]) |
| 963 | dir02 = direction(nodemap[0], nodemap[2]) |
| 964 | dir23 = direction(nodemap[2], nodemap[3]) |
| 965 | check_getroute_paths(l1, |
| 966 | nodemap[0], |
| 967 | nodemap[3], |
| 968 | 10000, |
| 969 | maxfee_msat=201, |
| 970 | paths=[[{'short_channel_id_dir': f'0x1x0/{dir01}'}, |
| 971 | {'short_channel_id_dir': f'3x3x2/{dir13}'}]]) |
| 972 | |
| 973 | # maxfee exceeded? lower prob path. |
| 974 | check_getroute_paths(l1, |
| 975 | nodemap[0], |
| 976 | nodemap[3], |
| 977 | 10000, |
| 978 | maxfee_msat=200, |
| 979 | paths=[[{'short_channel_id_dir': f'1x2x1/{dir02}'}, |
| 980 | {'short_channel_id_dir': f'5x3x3/{dir23}'}]]) |
| 981 | |
| 982 | |
| 983 | def test_getroutes_auto_sourcefree(node_factory): |
nothing calls this directly
no test coverage detected