itest: test blinded paths over private channels

This commit is contained in:
Elle Mouton
2024-07-24 09:49:56 +02:00
parent 74e45ec4bf
commit c62a9c235e

View File

@@ -884,7 +884,9 @@ func testErrorHandlingOnChainFailure(ht *lntest.HarnessTest) {
// The following graph is created where Dave is the destination node, and he // The following graph is created where Dave is the destination node, and he
// will choose Carol as the introduction node. The channel capacities are set in // will choose Carol as the introduction node. The channel capacities are set in
// such a way that Alice will have to split the payment to dave over both the // such a way that Alice will have to split the payment to dave over both the
// A->B->C-D and A->E->C->D routes. // A->B->C-D and A->E->C->D routes. The Carol-Dave channel will also be made
// a private channel so that we can test that Dave's private channels are in
// fact being used in the chosen blinded paths.
// //
// ---- Bob --- // ---- Bob ---
// / \ // / \
@@ -953,24 +955,32 @@ func testMPPToSingleBlindedPath(ht *lntest.HarnessTest) {
}, },
}, },
{ {
// Note that this is a private channel.
Local: carol, Local: carol,
Remote: dave, Remote: dave,
Param: lntest.OpenChannelParams{ Param: lntest.OpenChannelParams{
Amt: paymentAmt * 2, Amt: paymentAmt * 2,
Private: true,
}, },
}, },
} }
channelPoints := ht.OpenMultiChannelsAsync(reqs) channelPoints := ht.OpenMultiChannelsAsync(reqs)
// Make sure every node has heard about every channel. // Make sure every node has heard about every public channel.
for _, hn := range nodes { for _, hn := range nodes {
for _, cp := range channelPoints { var numPublic int
for i, cp := range channelPoints {
if reqs[i].Param.Private {
continue
}
numPublic++
ht.AssertTopologyChannelOpen(hn, cp) ht.AssertTopologyChannelOpen(hn, cp)
} }
// Each node should have exactly 5 edges. // Each node should have exactly numPublic edges.
ht.AssertNumEdges(hn, len(channelPoints), false) ht.AssertNumEdges(hn, numPublic, false)
} }
// Make Dave create an invoice with a blinded path for Alice to pay. // Make Dave create an invoice with a blinded path for Alice to pay.