itest: add coverage for hold invoices with hop hints
This PR updates the hold invoice itest to create a private channel, and sets the private option on the invoices created to add coverage for the addition of hop hints.
This commit is contained in:
1 file changed
+11
-5
@@ -13702,12 +13702,14 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
t.Fatalf("unable to connect alice to carol: %v", err)
|
t.Fatalf("unable to connect alice to carol: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open a channel between Alice and Carol.
|
// Open a channel between Alice and Carol which is private so that we
|
||||||
|
// cover the addition of hop hints for hold invoices.
|
||||||
ctxt, _ = context.WithTimeout(ctxb, channelOpenTimeout)
|
ctxt, _ = context.WithTimeout(ctxb, channelOpenTimeout)
|
||||||
chanPointAlice := openChannelAndAssert(
|
chanPointAlice := openChannelAndAssert(
|
||||||
ctxt, t, net, net.Alice, carol,
|
ctxt, t, net, net.Alice, carol,
|
||||||
lntest.OpenChannelParams{
|
lntest.OpenChannelParams{
|
||||||
Amt: chanAmt,
|
Amt: chanAmt,
|
||||||
|
Private: true,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -13748,10 +13750,14 @@ func testHoldInvoicePersistence(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
|
|
||||||
for _, preimage := range preimages {
|
for _, preimage := range preimages {
|
||||||
payHash := preimage.Hash()
|
payHash := preimage.Hash()
|
||||||
|
|
||||||
|
// Make our invoices private so that we get coverage for adding
|
||||||
|
// hop hints.
|
||||||
invoiceReq := &invoicesrpc.AddHoldInvoiceRequest{
|
invoiceReq := &invoicesrpc.AddHoldInvoiceRequest{
|
||||||
Memo: "testing",
|
Memo: "testing",
|
||||||
Value: int64(payAmt),
|
Value: int64(payAmt),
|
||||||
Hash: payHash[:],
|
Hash: payHash[:],
|
||||||
|
Private: true,
|
||||||
}
|
}
|
||||||
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
|
ctxt, _ = context.WithTimeout(ctxb, defaultTimeout)
|
||||||
resp, err := carol.AddHoldInvoice(ctxt, invoiceReq)
|
resp, err := carol.AddHoldInvoice(ctxt, invoiceReq)
|
||||||
|
|||||||
Reference in new issue
Block a user