pyln: add support for dependent hooks.

And use that to add simple tests.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2020-10-30 11:43:42 +10:30
committed by neil saitug
parent 6a55b4367e
commit e16ed0e207
5 changed files with 86 additions and 4 deletions

15
tests/plugins/dep_c.py Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env python3
from pyln.client import Plugin
"""A simple plugin that must come before dep_a.
"""
plugin = Plugin()
@plugin.hook('htlc_accepted', before=['dep_a.py'])
def on_htlc_accepted(htlc, plugin, **kwargs):
print("htlc_accepted called")
return {'result': 'continue'}
plugin.run()