pytest: Add a test for the commitment_revocation hook

This commit is contained in:
Christian Decker
2020-05-07 10:24:27 +09:30
committed by Rusty Russell
parent d1f8509060
commit 8f2ce1e638
2 changed files with 86 additions and 0 deletions

14
tests/plugins/watchtower.py Executable file
View 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()