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

Function check_getroute_paths

tests/test_askrene.py:712–734  ·  view source on GitHub ↗

Check that routes are as expected in result

(node,
                         source,
                         destination,
                         amount_msat,
                         paths,
                         maxparts=50,
                         layers=[],
                         maxfee_msat=1000,
                         final_cltv=99)

Source from the content-addressed store, hash-verified

710
711
712def check_getroute_paths(node,
713 source,
714 destination,
715 amount_msat,
716 paths,
717 maxparts=50,
718 layers=[],
719 maxfee_msat=1000,
720 final_cltv=99):
721 """Check that routes are as expected in result"""
722 getroutes = node.rpc.getroutes(source=source,
723 destination=destination,
724 amount_msat=amount_msat,
725 layers=layers,
726 maxfee_msat=maxfee_msat,
727 final_cltv=final_cltv,
728 maxparts=maxparts)
729
730 assert getroutes['probability_ppm'] <= 1000000
731 # Total delivered should be amount we told it to send.
732 assert amount_msat == sum([r['amount_msat'] for r in getroutes['routes']])
733
734 check_route_as_expected(getroutes['routes'], paths)
735
736
737def test_getroutes(node_factory):

Callers 4

test_getroutesFunction · 0.85

Calls 2

check_route_as_expectedFunction · 0.85
getroutesMethod · 0.80

Tested by

no test coverage detected