Skip to content

Commit 379bcfb

Browse files
committed
paymentsdb: add firstcustom records to unit tests
1 parent a8451a9 commit 379bcfb

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

payments/db/payment_test.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,11 +375,22 @@ func genPaymentCreationInfo(t *testing.T,
375375

376376
t.Helper()
377377

378+
// Add constant first hop custom records for testing for testing
379+
// purposes.
380+
firstHopCustomRecords := lnwire.CustomRecords{
381+
lnwire.MinCustomRecordsTlvType + 1: []byte("test_record_1"),
382+
lnwire.MinCustomRecordsTlvType + 2: []byte("test_record_2"),
383+
lnwire.MinCustomRecordsTlvType + 3: []byte{
384+
0x01, 0x02, 0x03, 0x04, 0x05,
385+
},
386+
}
387+
378388
return &PaymentCreationInfo{
379-
PaymentIdentifier: paymentHash,
380-
Value: testRoute.ReceiverAmt(),
381-
CreationTime: time.Unix(time.Now().Unix(), 0),
382-
PaymentRequest: []byte("hola"),
389+
PaymentIdentifier: paymentHash,
390+
Value: testRoute.ReceiverAmt(),
391+
CreationTime: time.Unix(time.Now().Unix(), 0),
392+
PaymentRequest: []byte("hola"),
393+
FirstHopCustomRecords: firstHopCustomRecords,
383394
}
384395
}
385396

0 commit comments

Comments
 (0)