add integration tests for LND lsp CLN client

This commit is contained in:
Jesse de Wit
2023-10-16 22:21:43 +02:00
parent 4640507c5f
commit c25a6e1a85
9 changed files with 79 additions and 10 deletions

View File

@@ -168,6 +168,23 @@ func testOfflineNotificationRegularForward(p *testParams) {
})
log.Printf(bobInvoice.Bolt11)
invoiceWithHint := bobInvoice.Bolt11
if !ContainsHopHint(p.t, bobInvoice.Bolt11) {
chans := p.BreezClient().Node().GetChannels()
assert.Len(p.t, chans, 1)
var id lntest.ShortChannelID
if chans[0].RemoteAlias != nil {
id = *chans[0].RemoteAlias
} else if chans[0].LocalAlias != nil {
id = *chans[0].LocalAlias
} else {
id = chans[0].ShortChannelID
}
invoiceWithHint = AddHopHint(p.BreezClient(), bobInvoice.Bolt11, p.Lsp(), id, nil)
}
log.Printf("invoice with hint: %v", invoiceWithHint)
log.Printf("Bob going offline")
p.BreezClient().Stop()
@@ -176,7 +193,7 @@ func testOfflineNotificationRegularForward(p *testParams) {
<-time.After(htlcInterceptorDelay)
log.Printf("Alice paying")
payResp := alice.Pay(bobInvoice.Bolt11)
payResp := alice.Pay(invoiceWithHint)
invoiceResult := p.BreezClient().Node().GetInvoice(bobInvoice.PaymentHash)
assert.Equal(p.t, payResp.PaymentPreimage, invoiceResult.PaymentPreimage)