Skip to content

Commit

Permalink
common, pay: actually test Dijkstra and route finding.
Browse files Browse the repository at this point in the history
Set up a simple line of channel pairs, where one should be preferred
over the other for our various reasons.  Make sure this works, both
using a low-level call to Dijkstra and at a higher level as the pay
plugin does.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
rustyrussell committed Mar 6, 2024
1 parent d705a0b commit 3ab7d6c
Show file tree
Hide file tree
Showing 3 changed files with 568 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/dijkstra.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* Without this, gheap is *really* slow! Comment out for debugging. */
#ifndef TESTING
#define NDEBUG
#endif
#include "config.h"
#include <ccan/cast/cast.h>
#include <common/dijkstra.h>
Expand Down
7 changes: 7 additions & 0 deletions plugins/test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ plugins/test/run-route-overlong: \
common/node_id.o \
common/route.o

plugins/test/run-route-calc: \
common/fp16.o \
common/gossmap.o \
common/node_id.o \
common/route.o \
gossipd/gossip_store_wiregen.o

$(PLUGIN_TEST_PROGRAMS): $(BITCOIN_OBJS) $(WIRE_OBJS) $(PLUGIN_TEST_COMMON_OBJS)

$(PLUGIN_TEST_OBJS): $(PLUGIN_FUNDER_HEADER) $(PLUGIN_FUNDER_SRC)
Expand Down
Loading

0 comments on commit 3ab7d6c

Please sign in to comment.