routing: pass BlindedPaymentPathSet around everywhere

Building on from the previous commit, here we pass the PathSet around
everywhere where we previously passed around the single BlindedPayment.
This commit is contained in:
Elle Mouton
2024-05-15 15:08:19 +02:00
parent 3d5f20b70f
commit 4a22ec8413
7 changed files with 94 additions and 92 deletions

View File

@@ -2223,11 +2223,6 @@ func TestNewRouteRequest(t *testing.T) {
finalExpiry: unblindedCltv,
err: ErrExpiryAndBlinded,
},
{
name: "invalid blinded payment",
blindedPayment: &BlindedPayment{},
err: ErrNoBlindedPath,
},
}
for _, testCase := range testCases {
@@ -2236,9 +2231,19 @@ func TestNewRouteRequest(t *testing.T) {
t.Run(testCase.name, func(t *testing.T) {
t.Parallel()
var blindedPathInfo *BlindedPaymentPathSet
if testCase.blindedPayment != nil {
blindedPathInfo, err = NewBlindedPaymentPathSet(
[]*BlindedPayment{
testCase.blindedPayment,
},
)
require.NoError(t, err)
}
req, err := NewRouteRequest(
source, testCase.target, 1000, 0, nil, nil,
testCase.routeHints, testCase.blindedPayment,
testCase.routeHints, blindedPathInfo,
testCase.finalExpiry,
)
require.ErrorIs(t, err, testCase.err)