mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-03 18:22:25 +02:00
invoices: small test fixes
This commit is contained in:
@@ -514,7 +514,7 @@ func testFailInvoiceLookupMPPPayAddrOnly(t *testing.T,
|
|||||||
// for the given HTLC.
|
// for the given HTLC.
|
||||||
ref := invpkg.InvoiceRefByHashAndAddr(payHash, payAddr)
|
ref := invpkg.InvoiceRefByHashAndAddr(payHash, payAddr)
|
||||||
_, err = db.LookupInvoice(ctxb, ref)
|
_, err = db.LookupInvoice(ctxb, ref)
|
||||||
require.Equal(t, invpkg.ErrInvoiceNotFound, err)
|
require.ErrorIs(t, err, invpkg.ErrInvoiceNotFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
// testInvRefEquivocation asserts that retrieving or updating an invoice using
|
// testInvRefEquivocation asserts that retrieving or updating an invoice using
|
||||||
@@ -692,7 +692,7 @@ func testInvoiceCancelSingleHtlcAMP(t *testing.T,
|
|||||||
|
|
||||||
// At this point, we should detect that 3k satoshis total has been
|
// At this point, we should detect that 3k satoshis total has been
|
||||||
// paid.
|
// paid.
|
||||||
require.Equal(t, dbInvoice.AmtPaid, amt*3)
|
require.EqualValues(t, amt*3, dbInvoice.AmtPaid)
|
||||||
|
|
||||||
callback := func(
|
callback := func(
|
||||||
invoice *invpkg.Invoice) (*invpkg.InvoiceUpdateDesc, error) {
|
invoice *invpkg.Invoice) (*invpkg.InvoiceUpdateDesc, error) {
|
||||||
@@ -968,7 +968,10 @@ func testInvoiceAddTimeSeries(t *testing.T,
|
|||||||
t.Fatalf("unable to query: %v", err)
|
t.Fatalf("unable to query: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
require.Equal(t, len(query.resp), len(resp))
|
require.Equal(
|
||||||
|
t, len(query.resp), len(resp),
|
||||||
|
fmt.Sprintf("test: #%v", i),
|
||||||
|
)
|
||||||
|
|
||||||
for j := 0; j < len(query.resp); j++ {
|
for j := 0; j < len(query.resp); j++ {
|
||||||
require.Equal(t,
|
require.Equal(t,
|
||||||
@@ -1146,7 +1149,11 @@ func testSettleIndexAmpPayments(t *testing.T,
|
|||||||
AddIndex: testInvoice.AddIndex,
|
AddIndex: testInvoice.AddIndex,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
require.Nil(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
|
settledInvoices, err = db.InvoicesSettledSince(ctxb, 0)
|
||||||
|
require.NoError(t, err)
|
||||||
|
require.Len(t, settledInvoices, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// testFetchPendingInvoices tests that we can fetch all pending invoices from
|
// testFetchPendingInvoices tests that we can fetch all pending invoices from
|
||||||
@@ -1670,7 +1677,8 @@ func testQueryInvoices(t *testing.T,
|
|||||||
t.Fatalf("unable to query invoice database: %v", err)
|
t.Fatalf("unable to query invoice database: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
require.Equal(t, len(testCase.expected), len(response.Invoices))
|
require.Equal(t, len(testCase.expected), len(response.Invoices),
|
||||||
|
fmt.Sprintf("test: #%v", i))
|
||||||
|
|
||||||
for j, expected := range testCase.expected {
|
for j, expected := range testCase.expected {
|
||||||
require.Equal(t,
|
require.Equal(t,
|
||||||
|
Reference in New Issue
Block a user