routing: use routingGraph interface in payment session

Preparation for more test coverage of payment session.

The function findPath now has the call signature of the former
findPathInternal function.
This commit is contained in:
Joost Jager
2020-03-17 11:32:07 +01:00
parent cb4cd49dc8
commit 47f9c1c3fd
9 changed files with 155 additions and 146 deletions

View File

@@ -79,11 +79,6 @@ func createTestCtxFromGraphInstance(startingHeight uint32, graphInstance *testGr
chain := newMockChain(startingHeight)
chainView := newMockChainView(chain)
selfNode, err := graphInstance.graph.SourceNode()
if err != nil {
return nil, nil, err
}
pathFindingConfig := PathFindingConfig{
MinProbability: 0.01,
PaymentAttemptPenalty: 100,
@@ -104,8 +99,7 @@ func createTestCtxFromGraphInstance(startingHeight uint32, graphInstance *testGr
}
sessionSource := &SessionSource{
Graph: graphInstance.graph,
SelfNode: selfNode,
Graph: graphInstance.graph,
QueryBandwidth: func(e *channeldb.ChannelEdgeInfo) lnwire.MilliSatoshi {
return lnwire.NewMSatFromSatoshis(e.Capacity)
},
@@ -2188,10 +2182,8 @@ func TestFindPathFeeWeighting(t *testing.T) {
// We'll now attempt a path finding attempt using this set up. Due to
// the edge weighting, we should select the direct path over the 2 hop
// path even though the direct path has a higher potential time lock.
path, err := findPath(
&graphParams{
graph: ctx.graph,
},
path, err := dbFindPath(
ctx.graph, nil, nil,
noRestrictions,
testPathFindingConfig,
sourceNode.PubKeyBytes, target, amt, 0,