Skip to content

Commit 6fd34f7

Browse files
committed
paymentsdb: add firstcustom records to unit tests
1 parent 3199071 commit 6fd34f7

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
@@ -383,11 +383,22 @@ func genPaymentCreationInfo(t *testing.T,
383383

384384
t.Helper()
385385

386+
// Add constant first hop custom records for testing for testing
387+
// purposes.
388+
firstHopCustomRecords := lnwire.CustomRecords{
389+
lnwire.MinCustomRecordsTlvType + 1: []byte("test_record_1"),
390+
lnwire.MinCustomRecordsTlvType + 2: []byte("test_record_2"),
391+
lnwire.MinCustomRecordsTlvType + 3: []byte{
392+
0x01, 0x02, 0x03, 0x04, 0x05,
393+
},
394+
}
395+
386396
return &PaymentCreationInfo{
387-
PaymentIdentifier: paymentHash,
388-
Value: testRoute.ReceiverAmt(),
389-
CreationTime: time.Unix(time.Now().Unix(), 0),
390-
PaymentRequest: []byte("hola"),
397+
PaymentIdentifier: paymentHash,
398+
Value: testRoute.ReceiverAmt(),
399+
CreationTime: time.Unix(time.Now().Unix(), 0),
400+
PaymentRequest: []byte("hola"),
401+
FirstHopCustomRecords: firstHopCustomRecords,
391402
}
392403
}
393404

0 commit comments

Comments
 (0)