core-lightning/tests/plugins/openchannel_hook_accept.py
niftynei 0e753224ae tests: remove EXPERIMENTAL_FEATURE flag from openchannel2 hooks
These are now included in all builds
2021-05-03 11:06:10 +09:30

27 lines
531 B
Python
Executable File

#!/usr/bin/env python3
"""Plugin to test openchannel_hook
Will simply accept any channel. Useful fot testing chained hook.
"""
from pyln.client import Plugin
plugin = Plugin()
@plugin.hook('openchannel')
def on_openchannel(openchannel, plugin, **kwargs):
msg = "accept on principle"
plugin.log(msg)
return {'result': 'continue'}
@plugin.hook('openchannel2')
def on_openchannel2(openchannel2, plugin, **kwargs):
msg = "accept on principle"
plugin.log(msg)
return {'result': 'continue'}
plugin.run()