mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 08:55:59 +01:00
invoices: small test fixes
This commit is contained in:
parent
39211d25ed
commit
734d3a9d66
1 changed files with 13 additions and 5 deletions
|
@ -514,7 +514,7 @@ func testFailInvoiceLookupMPPPayAddrOnly(t *testing.T,
|
|||
// for the given HTLC.
|
||||
ref := invpkg.InvoiceRefByHashAndAddr(payHash, payAddr)
|
||||
_, 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
|
||||
|
@ -692,7 +692,7 @@ func testInvoiceCancelSingleHtlcAMP(t *testing.T,
|
|||
|
||||
// At this point, we should detect that 3k satoshis total has been
|
||||
// paid.
|
||||
require.Equal(t, dbInvoice.AmtPaid, amt*3)
|
||||
require.EqualValues(t, amt*3, dbInvoice.AmtPaid)
|
||||
|
||||
callback := func(
|
||||
invoice *invpkg.Invoice) (*invpkg.InvoiceUpdateDesc, error) {
|
||||
|
@ -968,7 +968,10 @@ func testInvoiceAddTimeSeries(t *testing.T,
|
|||
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++ {
|
||||
require.Equal(t,
|
||||
|
@ -1146,7 +1149,11 @@ func testSettleIndexAmpPayments(t *testing.T,
|
|||
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
|
||||
|
@ -1670,7 +1677,8 @@ func testQueryInvoices(t *testing.T,
|
|||
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 {
|
||||
require.Equal(t,
|
||||
|
|
Loading…
Add table
Reference in a new issue