mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 09:04:22 +01:00
rename block_processed to block_added
This commit is contained in:
22
tests/plugins/block_added.py
Executable file
22
tests/plugins/block_added.py
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pyln.client import Plugin
|
||||
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
blocks_catched = []
|
||||
|
||||
|
||||
@plugin.subscribe("block_added")
|
||||
def notify_block_added(plugin, block, **kwargs):
|
||||
global blocks_catched
|
||||
blocks_catched.append(block["height"])
|
||||
|
||||
|
||||
@plugin.method("blockscatched")
|
||||
def return_moves(plugin):
|
||||
return blocks_catched
|
||||
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user