mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 06:54:30 +01:00
pytest: Add a test for the commitment_revocation hook
This commit is contained in:
committed by
Rusty Russell
parent
d1f8509060
commit
8f2ce1e638
14
tests/plugins/watchtower.py
Executable file
14
tests/plugins/watchtower.py
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from pyln.client import Plugin
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.hook('commitment_revocation')
|
||||
def on_commitment_revocation(commitment_txid, penalty_tx, plugin, **kwargs):
|
||||
with open('watchtower.csv', 'a') as f:
|
||||
f.write("{}, {}\n".format(commitment_txid, penalty_tx))
|
||||
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user