mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-05 12:39:54 +02:00
invoices: fix linter issues after the move
This commit is contained in:
parent
5e746b4d2c
commit
0e2b39ed44
@ -517,7 +517,9 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
|
|||||||
func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
|
func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.NoError(t, err, "unable to make test db: %v", err)
|
require.NoError(t, err, "unable to make test db: %v", err)
|
||||||
|
|
||||||
// We'll start out by creating an invoice and writing it to the DB.
|
// We'll start out by creating an invoice and writing it to the DB.
|
||||||
@ -691,11 +693,13 @@ func TestInvoiceCancelSingleHtlcAMP(t *testing.T) {
|
|||||||
|
|
||||||
// TestInvoiceTimeSeries tests that newly added invoices invoices, as well as
|
// TestInvoiceTimeSeries tests that newly added invoices invoices, as well as
|
||||||
// settled invoices are added to the database are properly placed in the add
|
// settled invoices are added to the database are properly placed in the add
|
||||||
// add or settle index which serves as an event time series.
|
// or settle index which serves as an event time series.
|
||||||
func TestInvoiceAddTimeSeries(t *testing.T) {
|
func TestInvoiceAddTimeSeries(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.NoError(t, err, "unable to make test db")
|
require.NoError(t, err, "unable to make test db")
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
@ -853,7 +857,9 @@ func TestSettleIndexAmpPayments(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
testClock := clock.NewTestClock(testNow)
|
testClock := clock.NewTestClock(testNow)
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
// First, we'll make a sample invoice that'll be paid to several times
|
// First, we'll make a sample invoice that'll be paid to several times
|
||||||
@ -1021,7 +1027,9 @@ func TestSettleIndexAmpPayments(t *testing.T) {
|
|||||||
func TestFetchPendingInvoices(t *testing.T) {
|
func TestFetchPendingInvoices(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.NoError(t, err, "unable to make test db")
|
require.NoError(t, err, "unable to make test db")
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
@ -1076,7 +1084,9 @@ func TestFetchPendingInvoices(t *testing.T) {
|
|||||||
func TestDuplicateSettleInvoice(t *testing.T) {
|
func TestDuplicateSettleInvoice(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.NoError(t, err, "unable to make test db")
|
require.NoError(t, err, "unable to make test db")
|
||||||
|
|
||||||
// We'll start out by creating an invoice and writing it to the DB.
|
// We'll start out by creating an invoice and writing it to the DB.
|
||||||
@ -1137,7 +1147,9 @@ func TestDuplicateSettleInvoice(t *testing.T) {
|
|||||||
func TestQueryInvoices(t *testing.T) {
|
func TestQueryInvoices(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.NoError(t, err, "unable to make test db")
|
require.NoError(t, err, "unable to make test db")
|
||||||
|
|
||||||
// To begin the test, we'll add 50 invoices to the database. We'll
|
// To begin the test, we'll add 50 invoices to the database. We'll
|
||||||
@ -1869,7 +1881,9 @@ func TestAddInvoiceWithHTLCs(t *testing.T) {
|
|||||||
// that invoices with duplicate set ids are disallowed.
|
// that invoices with duplicate set ids are disallowed.
|
||||||
func TestSetIDIndex(t *testing.T) {
|
func TestSetIDIndex(t *testing.T) {
|
||||||
testClock := clock.NewTestClock(testNow)
|
testClock := clock.NewTestClock(testNow)
|
||||||
db, err := channeldb.MakeTestInvoiceDB(t, channeldb.OptionClock(testClock))
|
db, err := channeldb.MakeTestInvoiceDB(
|
||||||
|
t, channeldb.OptionClock(testClock),
|
||||||
|
)
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
// We'll start out by creating an invoice and writing it to the DB.
|
// We'll start out by creating an invoice and writing it to the DB.
|
||||||
|
@ -199,6 +199,8 @@ func cancelHTLCs(invoice *Invoice, updateTime time.Time,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// addHTLCs tries to add the htlcs in the given InvoiceUpdateDesc.
|
// addHTLCs tries to add the htlcs in the given InvoiceUpdateDesc.
|
||||||
|
//
|
||||||
|
//nolint:funlen
|
||||||
func addHTLCs(invoice *Invoice, hash *lntypes.Hash, updateTime time.Time,
|
func addHTLCs(invoice *Invoice, hash *lntypes.Hash, updateTime time.Time,
|
||||||
update *InvoiceUpdateDesc, updater InvoiceUpdater) error {
|
update *InvoiceUpdateDesc, updater InvoiceUpdater) error {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user