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

Function check_getroute_paths

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

663
664
665def check_getroute_paths(node,
666 source,
667 destination,
668 amount_msat,
669 paths,
670 maxparts=50,
671 layers=[],
672 maxfee_msat=1000,
673 final_cltv=99):
674 """Check that routes are as expected in result"""
675 getroutes = node.rpc.getroutes(source=source,
676 destination=destination,
677 amount_msat=amount_msat,
678 layers=layers,
679 maxfee_msat=maxfee_msat,
680 final_cltv=final_cltv,
681 maxparts=maxparts)
682
683 assert getroutes['probability_ppm'] <= 1000000
684 # Total delivered should be amount we told it to send.
685 assert amount_msat == sum([r['amount_msat'] for r in getroutes['routes']])
686
687 check_route_as_expected(getroutes['routes'], paths)
688
689
690def 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