lnrpc+routing: remove k shortest path finding

This commit is contained in:
Joost Jager committed 2019-05-07 19:54:06 +02:00
1 parent c4415f0400
commit 7a5bd29a69
13 files changed
+714 -1228

No files matched your search

+4 -12
View File
@@ -42,7 +42,6 @@ func TestQueryRoutes(t *testing.T) {
request := &lnrpc.QueryRoutesRequest{
PubKey: destKey,
Amt: 100000,
NumRoutes: 1,
FinalCltvDelta: 100,
FeeLimit: &lnrpc.FeeLimit{
Limit: &lnrpc.FeeLimit_Fixed{
@@ -58,19 +57,14 @@ func TestQueryRoutes(t *testing.T) {
rt := &route.Route{}
findRoutes := func(source, target route.Vertex,
findRoute := func(source, target route.Vertex,
amt lnwire.MilliSatoshi, restrictions *routing.RestrictParams,
numPaths uint32, finalExpiry ...uint16) (
[]*route.Route, error) {
finalExpiry ...uint16) (*route.Route, error) {
if int64(amt) != request.Amt*1000 {
t.Fatal("unexpected amount")
}
if numPaths != 1 {
t.Fatal("unexpected number of routes")
}
if source != sourceKey {
t.Fatal("unexpected source key")
}
@@ -101,14 +95,12 @@ func TestQueryRoutes(t *testing.T) {
t.Fatal("unexpected ignored node")
}
return []*route.Route{
rt,
}, nil
return rt, nil
}
backend := &RouterBackend{
MaxPaymentMSat: lnwire.NewMSatFromSatoshis(1000000),
FindRoutes: findRoutes,
FindRoute: findRoute,
SelfNode: route.Vertex{1, 2, 3},
FetchChannelCapacity: func(chanID uint64) (
btcutil.Amount, error) {