Browse Source
Two tests: one for failures and one for in-path resolution. Signed-off-by: Christian Decker <decker.christian@gmail.com>htlc_accepted_hook
committed by
Rusty Russell
3 changed files with 81 additions and 0 deletions
@ -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() |
@ -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() |
Loading…
Reference in new issue