mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 23:24:27 +01:00
pytest: Add a zeroreserve test
This commit is contained in:
27
tests/plugins/zeroreserve.py
Executable file
27
tests/plugins/zeroreserve.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Use the openchannel hook to selectively opt-into zeroconf
|
||||
"""
|
||||
|
||||
from pyln.client import Plugin
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.hook('openchannel')
|
||||
def on_openchannel(openchannel, plugin, **kwargs):
|
||||
plugin.log(repr(openchannel))
|
||||
reserve = plugin.options['reserve']['value']
|
||||
|
||||
if reserve is None:
|
||||
return {'result': 'continue'}
|
||||
else:
|
||||
return {'result': 'continue', 'reserve': reserve}
|
||||
|
||||
|
||||
plugin.add_option(
|
||||
'reserve',
|
||||
None,
|
||||
'Absolute reserve to require from peers when accepting channels',
|
||||
)
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user