From e40c8df16b6ff9cffb5691a4e4a5c15f1786a008 Mon Sep 17 00:00:00 2001 From: ziggie Date: Fri, 17 Oct 2025 09:23:27 +0200 Subject: [PATCH] paymentsdb: add firstcustom records to unit tests --- payments/db/payment_test.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/payments/db/payment_test.go b/payments/db/payment_test.go index 5439a8b6b..c788ca37d 100644 --- a/payments/db/payment_test.go +++ b/payments/db/payment_test.go @@ -383,11 +383,22 @@ func genPaymentCreationInfo(t *testing.T, t.Helper() + // Add constant first hop custom records for testing for testing + // purposes. + firstHopCustomRecords := lnwire.CustomRecords{ + lnwire.MinCustomRecordsTlvType + 1: []byte("test_record_1"), + lnwire.MinCustomRecordsTlvType + 2: []byte("test_record_2"), + lnwire.MinCustomRecordsTlvType + 3: []byte{ + 0x01, 0x02, 0x03, 0x04, 0x05, + }, + } + return &PaymentCreationInfo{ - PaymentIdentifier: paymentHash, - Value: testRoute.ReceiverAmt(), - CreationTime: time.Unix(time.Now().Unix(), 0), - PaymentRequest: []byte("hola"), + PaymentIdentifier: paymentHash, + Value: testRoute.ReceiverAmt(), + CreationTime: time.Unix(time.Now().Unix(), 0), + PaymentRequest: []byte("hola"), + FirstHopCustomRecords: firstHopCustomRecords, } }