diff --git a/invoices/invoiceregistry_test.go b/invoices/invoiceregistry_test.go index 55bbd4931..aca609386 100644 --- a/invoices/invoiceregistry_test.go +++ b/invoices/invoiceregistry_test.go @@ -1504,10 +1504,26 @@ func TestSettleInvoicePaymentAddrRequiredOptionalGrace(t *testing.T) { require.Equal(t, subscription.PayHash(), &testInvoicePaymentHash) - // Add the invoice, which requires the MPP payload to always be + invoice := &invpkg.Invoice{ + Terms: invpkg.ContractTerm{ + PaymentPreimage: &testInvoicePreimage, + Value: testInvoiceAmt, + Expiry: time.Hour, + Features: lnwire.NewFeatureVector( + lnwire.NewRawFeatureVector( + lnwire.TLVOnionPayloadOptional, + lnwire.PaymentAddrOptional, + ), + lnwire.Features, + ), + }, + CreationDate: testInvoiceCreationDate, + } + + // Add the invoice, which does not require the MPP payload to always be // included due to its set of feature bits. addIdx, err := ctx.registry.AddInvoice( - testPayAddrOptionalInvoice, testInvoicePaymentHash, + invoice, testInvoicePaymentHash, ) require.NoError(t, err) require.Equal(t, int(addIdx), 1) @@ -1560,7 +1576,7 @@ func TestSettleInvoicePaymentAddrRequiredOptionalGrace(t *testing.T) { t.Fatalf("expected state ContractOpen, but got %v", update.State) } - if update.AmtPaid != testPayAddrOptionalInvoice.Terms.Value { + if update.AmtPaid != invoice.Terms.Value { t.Fatal("invoice AmtPaid incorrect") } case <-time.After(testTimeout): diff --git a/invoices/test_utils_test.go b/invoices/test_utils_test.go index 53f85d1a5..9abcf5f19 100644 --- a/invoices/test_utils_test.go +++ b/invoices/test_utils_test.go @@ -149,22 +149,6 @@ var ( }, CreationDate: testInvoiceCreationDate, } - - testPayAddrOptionalInvoice = &invpkg.Invoice{ - Terms: invpkg.ContractTerm{ - PaymentPreimage: &testInvoicePreimage, - Value: testInvoiceAmt, - Expiry: time.Hour, - Features: lnwire.NewFeatureVector( - lnwire.NewRawFeatureVector( - lnwire.TLVOnionPayloadOptional, - lnwire.PaymentAddrOptional, - ), - lnwire.Features, - ), - }, - CreationDate: testInvoiceCreationDate, - } ) func newTestChannelDB(t *testing.T, clock clock.Clock) (*channeldb.DB, error) {