pytest: peer_connected chainable tests

This commit is contained in:
Michael Schmoock
2021-01-26 19:35:33 +01:00
committed by Rusty Russell
parent 91bdb6d2d9
commit bc40287ade
3 changed files with 57 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
#!/usr/bin/env python3
"""Simple plugin to log the connected_hook.
"""
from pyln.client import Plugin
plugin = Plugin()
@plugin.hook('peer_connected')
def on_connected(peer, plugin, **kwargs):
print("peer_connected_logger_a {}".format(peer['id']))
return {'result': 'continue'}
plugin.run()