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

Function test_hook_dep_stable

tests/test_plugin.py:2931–2954  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

2929
2930
2931def test_hook_dep_stable(node_factory):
2932 # Load in order A, D, E, B.
2933 # A says it has to be before B, D says it has to be before E.
2934 # It should load in the order specified.
2935
2936 dep_a = os.path.join(os.path.dirname(__file__), 'plugins/dep_a.py')
2937 dep_b = os.path.join(os.path.dirname(__file__), 'plugins/dep_b.py')
2938 dep_d = os.path.join(os.path.dirname(__file__), 'plugins/dep_d.py')
2939 dep_e = os.path.join(os.path.dirname(__file__), 'plugins/dep_e.py')
2940 l1, l2 = node_factory.line_graph(2, opts=[{},
2941 {'plugin': [dep_a, dep_d, dep_e, dep_b]}])
2942
2943 # dep_a mentions deb_c, but nothing else should be unknown.
2944 # (Could be already past)
2945 l2.daemon.logsearch_start = 0
2946 l2.daemon.wait_for_log("unknown plugin dep_c.py")
2947 assert not l2.daemon.is_in_log("unknown plugin (?!|dep_c.py)")
2948
2949 l1.pay(l2, 100000)
2950 # They must be called in this order!
2951 l2.daemon.wait_for_log(r"dep_a.py: htlc_accepted called")
2952 l2.daemon.wait_for_log(r"dep_d.py: htlc_accepted called")
2953 l2.daemon.wait_for_log(r"dep_e.py: htlc_accepted called")
2954 l2.daemon.wait_for_log(r"dep_b.py: htlc_accepted called")
2955
2956
2957def test_htlc_accepted_hook_failonion(node_factory):

Callers

nothing calls this directly

Calls 5

joinMethod · 0.80
line_graphMethod · 0.80
wait_for_logMethod · 0.80
is_in_logMethod · 0.80
payMethod · 0.45

Tested by

no test coverage detected