mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
pytest: Add a test for the event subscription and notification
Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
@@ -24,5 +24,15 @@ def init(options, configuration, plugin):
|
||||
plugin.log("Plugin helloworld.py initialized")
|
||||
|
||||
|
||||
@plugin.subscribe("connect")
|
||||
def on_connect(id, address, plugin):
|
||||
plugin.log("Received connect event for peer {}".format(id))
|
||||
|
||||
|
||||
@plugin.subscribe("disconnect")
|
||||
def on_disconnect(id, plugin):
|
||||
plugin.log("Received disconnect event for peer {}".format(id))
|
||||
|
||||
|
||||
plugin.add_option('greeting', 'Hello', 'The greeting I should use.')
|
||||
plugin.run()
|
||||
|
||||
Reference in New Issue
Block a user