-
Notifications
You must be signed in to change notification settings - Fork 911
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyln: add support for dependent hooks.
And use that to add simple tests. Signed-off-by: Rusty Russell <[email protected]>
- Loading branch information
1 parent
1da5384
commit 8809845
Showing
5 changed files
with
87 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
from pyln.client import Plugin | ||
from hashlib import sha256 | ||
from binascii import hexlify | ||
|
||
"""A simple plugin that must come before dep_b. | ||
""" | ||
plugin = Plugin() | ||
|
||
|
||
@plugin.hook('htlc_accepted', before=['dep_b.py']) | ||
def on_htlc_accepted(htlc, plugin, **kwargs): | ||
print("htlc_accepted called") | ||
return {'result': 'continue'} | ||
|
||
|
||
plugin.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python3 | ||
from pyln.client import Plugin | ||
from hashlib import sha256 | ||
from binascii import hexlify | ||
|
||
"""A simple plugin that must come after dep_a, before dep_c. | ||
""" | ||
plugin = Plugin() | ||
|
||
|
||
@plugin.hook('htlc_accepted', before=['dep_c.py'], after=['dep_a.py']) | ||
def on_htlc_accepted(htlc, plugin, **kwargs): | ||
print("htlc_accepted called") | ||
return {'result': 'continue'} | ||
|
||
|
||
plugin.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env python3 | ||
from pyln.client import Plugin | ||
from hashlib import sha256 | ||
from binascii import hexlify | ||
|
||
"""A simple plugin that must come before dep_a. | ||
""" | ||
plugin = Plugin() | ||
|
||
|
||
@plugin.hook('htlc_accepted', before=['dep_a.py']) | ||
def on_htlc_accepted(htlc, plugin, **kwargs): | ||
print("htlc_accepted called") | ||
return {'result': 'continue'} | ||
|
||
|
||
plugin.run() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters