Rusty Russell
df8a6f615b
pytest: test for crash when we do a plugin op and a plugin has not finished init
We try to start it twice, with predictable hilarious results:
DEBUG plugin-manager started(20701) /home/rusty/devel/cvs/lightning/tests/plugins/slow_init.py
DEBUG lightningd(20670): Adding block 101: 0f26301caaae390d1b956c3eb73827d1f87a2af306561348045bf1313b7551b0
INFO plugin-slow_init.py slow_init.py initializing
DEBUG plugin-manager started(20704) /home/rusty/devel/cvs/lightning/tests/plugins/slow_init.py
**BROKEN** lightningd(20670): FATAL SIGNAL 6 (version v0.7.1-146-g7d3b352-modded)
**BROKEN** lightningd(20670): backtrace: common/daemon.c:45 (send_backtrace) 0x55a29c3ec539
**BROKEN** lightningd(20670): backtrace: common/daemon.c:53 (crashdump) 0x55a29c3ec589
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281ebcf5f
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281ebced7
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281e9e534
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281e9e40e
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281eae011
**BROKEN** lightningd(20670): backtrace: lightningd/json_stream.c:225 (json_stream_output_) 0x55a29c3bff5f
**BROKEN** lightningd(20670): backtrace: lightningd/plugin.c:383 (plugin_write_json) 0x55a29c3e103f
**BROKEN** lightningd(20670): backtrace: ccan/ccan/io/io.c:59 (next_plan) 0x55a29c43316b
**BROKEN** lightningd(20670): backtrace: ccan/ccan/io/io.c:435 (io_do_always) 0x55a29c433df1
**BROKEN** lightningd(20670): backtrace: ccan/ccan/io/poll.c:300 (handle_always) 0x55a29c435865
**BROKEN** lightningd(20670): backtrace: ccan/ccan/io/poll.c:377 (io_loop) 0x55a29c435b3d
**BROKEN** lightningd(20670): backtrace: lightningd/io_loop_with_timers.c:24 (io_loop_with_timers) 0x55a29c3bdfcf
**BROKEN** lightningd(20670): backtrace: lightningd/lightningd.c:830 (main) 0x55a29c3c44b6
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x7fa281e9fb6a
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0x55a29c3ac0f9
**BROKEN** lightningd(20670): backtrace: (null):0 ((null)) 0xffffffffffffffff
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
darosior
307fb0708e
lightningd/plugin_control: don't control non-dynamic plugins
6 years ago
darosior
2683170da8
Test and document 'channel_opened' notification
6 years ago
Christian Decker
53488e5739
pytest: Strengthen the htlc_accepted tests
We were having a few issues with malformed data in the past, so this time we
really check that stuff.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago
Rusty Russell
380c044668
tests: add plugin for simple invoice delay.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
trueptolemy
4d08ed2fa6
pytest: Add a test for the 'warning' subscription and notification
1. Create a plugin: ./lightning/tests/plugins/pretend_badlog.py
This plugin subscribes 'warning' notification and log the payload of
'warning';
2. Add a new test: tests/test_plugin.py::test_warning_notification
This test runs the plugin-pretend_badlog.py and check if 'warning'
notification can be normal triggered and subscribed.
6 years ago
Christian Decker
dd26a01c54
pytest: Add a test for htlc_accepted hook replay on startup
6 years ago
Christian Decker
9fd8be6463
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>
6 years ago
Rusty Russell
e5b5f1d7e5
openingd: add openchannel hook.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
ca7864f2f3
invoice_hook: remove nested result.
I misunderstood the API, this ended up nesting a result inside the JSON-RPC
result.
No concerns about backwards compatibility since this is so new.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
7f7ad4f89f
connected_hook: allow hook to specify an error message.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
9c373fecb6
pytest: test the invoice hook.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
7ccf3af51d
pytest: test the db hook plugin.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
5f437de771
pytest: test passing utf8 into and out of plugin JSON.
We should be able to pass UTF-8 strings to and from plugins without
python turning them into JSON-\u escapes.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Rusty Russell
c7316d7ba2
pytest: test that we translate to and from Millisatoshi on plugin RPC.
We don't, but we should, like we do for normal RPC. However, I chose
to use function annotations, rather than names-ending-in-'msat'
because it's more Pythony.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
Christian Decker
7f11b4854e
pylightning: Split @method and @async_method decorators
Suggested-by: Rusty Russell <@rustyrussell>
Suggested-by: Conor Scott <@conscott>
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago
Christian Decker
571fb44d20
pylightning: Add a small test for async rpcmethods
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago
Christian Decker
5d9d5ceed1
pytest: Test the new peer_connected hook with a reject plugin
This plugin just rejects `node_id`s it gets told about.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago