mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 16:14:23 +01:00
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:
committed by
Rusty Russell
parent
2b81e02a2e
commit
9fd8be6463
15
tests/plugins/fail_htlcs.py
Executable file
15
tests/plugins/fail_htlcs.py
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from lightning import Plugin
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.hook("htlc_accepted")
|
||||
def on_htlc_accepted(htlc, onion, plugin):
|
||||
plugin.log("Failing htlc on purpose")
|
||||
plugin.log("onion: %r" % (onion))
|
||||
return {"result": "fail", "failure_code": 16399}
|
||||
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user