paymentsdb: add firstcustom records to unit tests
What changed, and why it matters
This commit only updates a unit test file to include sample custom records when creating test payment data. It does not change any production code, network behavior, or security logic. There is no security issue here.
No action required. This is a benign test-only change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies payments/db/payment_test.go, specifically the genPaymentCreationInfo helper used in tests. It adds a FirstHopCustomRecords field populated with dummy lnwire.CustomRecords entries. This is a test-only change adding fixture data; no runtime code paths are altered.
Changed components
payments/db/payment_test.goInspect captured patch +15 / −4
diff --git a/payments/db/payment_test.go b/payments/db/payment_test.go
index 5439a8b..c788ca3 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,
}
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.