core-lightning/tests/plugins/block_added.py
Shahana Farooqui 4e5e38f4b0 tests: notification response fixes
tests: notification response fixes
2023-07-10 14:51:11 +09:30

23 lines
362 B
Python
Executable File

#!/usr/bin/env python3
from pyln.client import Plugin
plugin = Plugin()
blocks_catched = []
@plugin.subscribe("block_added")
def notify_block_added(plugin, block_added, **kwargs):
global blocks_catched
blocks_catched.append(block_added["height"])
@plugin.method("blockscatched")
def return_moves(plugin):
return blocks_catched
plugin.run()