mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
paymod: Add a simple test-command to test the paymod state-machine
This commit can be reverted/skipped once we have implemented all the logic and have feature parity with the normal `pay`. It's main purpose is to expose the unfinished functionality to test it, without completely breaking the existing `pay` command.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include <plugins/libplugin-pay.h>
|
||||
#include <stdio.h>
|
||||
|
||||
struct payment *payment_new(tal_t *ctx, struct command *cmd,
|
||||
struct payment *parent,
|
||||
@@ -144,3 +145,19 @@ void payment_continue(struct payment *p)
|
||||
* `payment_continue` after the final state. */
|
||||
abort();
|
||||
}
|
||||
|
||||
static inline struct dummy_data *
|
||||
dummy_data_init(struct payment *p)
|
||||
{
|
||||
return tal(p, struct dummy_data);
|
||||
}
|
||||
|
||||
static inline void dummy_step_cb(struct dummy_data *dd,
|
||||
struct payment *p)
|
||||
{
|
||||
fprintf(stderr, "dummy_step_cb called for payment %p at step %d\n", p, p->step);
|
||||
payment_continue(p);
|
||||
}
|
||||
|
||||
REGISTER_PAYMENT_MODIFIER(dummy, struct dummy_data *, dummy_data_init,
|
||||
dummy_step_cb);
|
||||
|
||||
Reference in New Issue
Block a user