pytest: Add tests for htlc_accepted_hook

Two tests: one for failures and one for in-path resolution.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-01-11 22:39:18 +01:00
committed by Rusty Russell
parent 2b81e02a2e
commit 9fd8be6463
3 changed files with 81 additions and 0 deletions

13
tests/plugins/shortcircuit.py Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
from lightning import Plugin
plugin = Plugin()
@plugin.hook("htlc_accepted")
def on_htlc_accepted(onion, htlc, plugin):
return {"result": "resolve", "payment_key": "00" * 32}
plugin.run()