What changed, and why it matters
This commit only adds missing documentation comments to helper functions in a test file. It does not change any executable code, behavior, or security logic.
Recommended action
No action needed. This is a non-functional documentation change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds three Go function comments in payments/db/payment_test.go: one for genPreimage, one for genInfo, and one for testDeleteFailedAttempts. No code logic, imports, signatures, or behavior were modified. It is a documentation-only change in test code.
Changed components
payments/db/payment_test.goInspect captured patch +4 / −0
diff --git a/payments/db/payment_test.go b/payments/db/payment_test.go
index ba17dc9..ea5fcb8 100644
--- a/payments/db/payment_test.go
+++ b/payments/db/payment_test.go
@@ -330,6 +330,7 @@ func assertDBPayments(t *testing.T, paymentDB DB, payments []*payment) {
require.Equal(t, payments, p)
}
+// genPreimage generates a random preimage.
func genPreimage() ([32]byte, error) {
var preimage [32]byte
if _, err := io.ReadFull(rand.Reader, preimage[:]); err != nil {
@@ -339,6 +340,7 @@ func genPreimage() ([32]byte, error) {
return preimage, nil
}
+// genInfo generates a payment creation info, an attempt info and a preimage.
func genInfo(t *testing.T) (*PaymentCreationInfo, *HTLCAttemptInfo,
lntypes.Preimage, error) {
@@ -378,6 +380,8 @@ func TestDeleteFailedAttempts(t *testing.T) {
})
}
+// testDeleteFailedAttempts tests the DeleteFailedAttempts method with the
+// given keepFailedPaymentAttempts flag as argument.
func testDeleteFailedAttempts(t *testing.T, keepFailedPaymentAttempts bool) {
paymentDB := NewTestDB(
t, WithKeepFailedPaymentAttempts(keepFailedPaymentAttempts),
Risk score
Our methodology →Why this scored 15/100
Human-validated context
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
No validated notes yet.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.