mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
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:
committed by
neil saitug
parent
6a55b4367e
commit
e16ed0e207
15
tests/plugins/dep_c.py
Executable file
15
tests/plugins/dep_c.py
Executable 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()
|
||||
Reference in New Issue
Block a user